environment

package
v0.1.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

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

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory

func NewClientFactory(credential azcore.TokenCredential, endpoint *string, options *azcore.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • endpoint - pass nil to accept the default values.
  • options - pass nil to accept the default values.

func NewClientFactoryWithClient

func NewClientFactoryWithClient(client fabric.Client) *ClientFactory

NewClientFactoryWithClient creates a new instance of ClientFactory with sharable Client. The Client will be propagated to any client created from this factory.

  • client - Client created in the containing module: github.com/microsoft/fabric-sdk-go/fabric

func (*ClientFactory) NewItemsClient

func (c *ClientFactory) NewItemsClient() *ItemsClient

NewItemsClient creates a new instance of ItemsClient.

func (*ClientFactory) NewSparkComputeClient

func (c *ClientFactory) NewSparkComputeClient() *SparkComputeClient

NewSparkComputeClient creates a new instance of SparkComputeClient.

func (*ClientFactory) NewSparkLibrariesClient

func (c *ClientFactory) NewSparkLibrariesClient() *SparkLibrariesClient

NewSparkLibrariesClient creates a new instance of SparkLibrariesClient.

type ComponentPublishInfo

type ComponentPublishInfo struct {
	// Spark libraries publish information.
	SparkLibraries *SparkLibraries

	// Spark settings publish information.
	SparkSettings *SparkSettings
}

ComponentPublishInfo - Publish info for each components in environment.

func (ComponentPublishInfo) MarshalJSON

func (c ComponentPublishInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ComponentPublishInfo.

func (*ComponentPublishInfo) UnmarshalJSON

func (c *ComponentPublishInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPublishInfo.

type CreateEnvironmentRequest

type CreateEnvironmentRequest struct {
	// REQUIRED; The environment display name.
	DisplayName *string

	// The environment description. Maximum length is 256 characters.
	Description *string
}

CreateEnvironmentRequest - Create environment request payload.

func (CreateEnvironmentRequest) MarshalJSON

func (c CreateEnvironmentRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateEnvironmentRequest.

func (*CreateEnvironmentRequest) UnmarshalJSON

func (c *CreateEnvironmentRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateEnvironmentRequest.

type CustomLibraries

type CustomLibraries struct {
	// A list of Jar files.
	JarFiles []string

	// A list of Python files.
	PyFiles []string

	// A list of R files.
	RTarFiles []string

	// A list of Wheel files.
	WheelFiles []string
}

CustomLibraries - Custom libraries.

func (CustomLibraries) MarshalJSON

func (c CustomLibraries) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomLibraries.

func (*CustomLibraries) UnmarshalJSON

func (c *CustomLibraries) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomLibraries.

type CustomPoolType

type CustomPoolType string

CustomPoolType - Custom pool type. Additional CustomPoolType types may be added over time.

const (
	// CustomPoolTypeCapacity - Capacity custom pool
	CustomPoolTypeCapacity CustomPoolType = "Capacity"
	// CustomPoolTypeWorkspace - Workspace custom pool
	CustomPoolTypeWorkspace CustomPoolType = "Workspace"
)

func PossibleCustomPoolTypeValues

func PossibleCustomPoolTypeValues() []CustomPoolType

PossibleCustomPoolTypeValues returns the possible values for the CustomPoolType const type.

type DynamicExecutorAllocationProperties

type DynamicExecutorAllocationProperties struct {
	// REQUIRED; The status of the dynamic executor allocation. False - Disabled, true - Enabled.
	Enabled *bool

	// REQUIRED; The maximum executor number for dynamic allocation and the minimum for this property is 1
	MaxExecutors *int32

	// REQUIRED; The minimum executor number for dynamic allocation and the minimum for this property is 1.
	MinExecutors *int32
}

DynamicExecutorAllocationProperties - Dynamic executor allocation proerties.

func (DynamicExecutorAllocationProperties) MarshalJSON

func (d DynamicExecutorAllocationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DynamicExecutorAllocationProperties.

func (*DynamicExecutorAllocationProperties) UnmarshalJSON

func (d *DynamicExecutorAllocationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DynamicExecutorAllocationProperties.

type Environment

type Environment struct {
	// REQUIRED; The item type.
	Type *ItemType

	// The item description.
	Description *string

	// The item display name.
	DisplayName *string

	// The environment properties.
	Properties *PublishInfo

	// READ-ONLY; The item ID.
	ID *string

	// READ-ONLY; The workspace ID.
	WorkspaceID *string
}

Environment - An Environment item.

func (Environment) MarshalJSON

func (e Environment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Environment.

func (*Environment) UnmarshalJSON

func (e *Environment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Environment.

type Environments

type Environments struct {
	// REQUIRED; A list of environments.
	Value []Environment

	// The token for the next result set batch. If there are no more records, it's removed from the response.
	ContinuationToken *string

	// The URI of the next result set batch. If there are no more records, it's removed from the response.
	ContinuationURI *string
}

Environments - A list of environments.

func (Environments) MarshalJSON

func (e Environments) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Environments.

func (*Environments) UnmarshalJSON

func (e *Environments) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Environments.

type InstancePool

type InstancePool struct {
	// REQUIRED; Instance pool name.
	Name *string

	// REQUIRED; Instance pool type.
	Type *CustomPoolType

	// Instance pool ID.
	ID *string
}

func (InstancePool) MarshalJSON

func (i InstancePool) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InstancePool.

func (*InstancePool) UnmarshalJSON

func (i *InstancePool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InstancePool.

type ItemType

type ItemType string

ItemType - The type of the item. Additional item types may be added over time.

const (
	// ItemTypeDashboard - PowerBI dashboard.
	ItemTypeDashboard ItemType = "Dashboard"
	// ItemTypeDataPipeline - A data pipeline.
	ItemTypeDataPipeline ItemType = "DataPipeline"
	// ItemTypeDatamart - PowerBI datamart.
	ItemTypeDatamart ItemType = "Datamart"
	// ItemTypeEnvironment - An environment.
	ItemTypeEnvironment ItemType = "Environment"
	// ItemTypeEventhouse - An eventhouse.
	ItemTypeEventhouse ItemType = "Eventhouse"
	// ItemTypeEventstream - An eventstream.
	ItemTypeEventstream ItemType = "Eventstream"
	// ItemTypeKQLDashboard - A KQL dashboard.
	ItemTypeKQLDashboard ItemType = "KQLDashboard"
	// ItemTypeKQLDatabase - A KQL database.
	ItemTypeKQLDatabase ItemType = "KQLDatabase"
	// ItemTypeKQLQueryset - A KQL queryset.
	ItemTypeKQLQueryset ItemType = "KQLQueryset"
	// ItemTypeLakehouse - A lakehouse.
	ItemTypeLakehouse ItemType = "Lakehouse"
	// ItemTypeMLExperiment - A machine learning experiment.
	ItemTypeMLExperiment ItemType = "MLExperiment"
	// ItemTypeMLModel - A machine learning model.
	ItemTypeMLModel ItemType = "MLModel"
	// ItemTypeMirroredDatabase - A mirrored database.
	ItemTypeMirroredDatabase ItemType = "MirroredDatabase"
	// ItemTypeMirroredWarehouse - A mirrored warehouse.
	ItemTypeMirroredWarehouse ItemType = "MirroredWarehouse"
	// ItemTypeNotebook - A notebook.
	ItemTypeNotebook ItemType = "Notebook"
	// ItemTypePaginatedReport - PowerBI paginated report.
	ItemTypePaginatedReport ItemType = "PaginatedReport"
	// ItemTypeReflex - A Reflex.
	ItemTypeReflex ItemType = "Reflex"
	// ItemTypeReport - PowerBI report.
	ItemTypeReport ItemType = "Report"
	// ItemTypeSQLEndpoint - An SQL endpoint.
	ItemTypeSQLEndpoint ItemType = "SQLEndpoint"
	// ItemTypeSemanticModel - PowerBI semantic model.
	ItemTypeSemanticModel ItemType = "SemanticModel"
	// ItemTypeSparkJobDefinition - A spark job definition.
	ItemTypeSparkJobDefinition ItemType = "SparkJobDefinition"
	// ItemTypeWarehouse - A warehouse.
	ItemTypeWarehouse ItemType = "Warehouse"
)

func PossibleItemTypeValues

func PossibleItemTypeValues() []ItemType

PossibleItemTypeValues returns the possible values for the ItemType const type.

type ItemsClient

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

ItemsClient contains the methods for the Items group. Don't use this type directly, use a constructor function instead.

func (*ItemsClient) BeginCreateEnvironment

func (client *ItemsClient) BeginCreateEnvironment(ctx context.Context, workspaceID string, createEnvironmentRequest CreateEnvironmentRequest, options *ItemsClientBeginCreateEnvironmentOptions) (*runtime.Poller[ItemsClientCreateEnvironmentResponse], error)

BeginCreateEnvironment - This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation]. This API does not support create a environment with definition. PERMISSIONS THE CALLER MUST HAVE CONTRIBUTOR OR HIGHER WORKSPACE ROLE. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All or Item.ReadWrite.All LIMITATIONS * To create an environment, the workspace must be on a supported Fabric capacity. MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • createEnvironmentRequest - Create item request payload.
  • options - ItemsClientBeginCreateEnvironmentOptions contains the optional parameters for the ItemsClient.BeginCreateEnvironment method.
Example

Generated from example definition

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/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewItemsClient().BeginCreateEnvironment(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", environment.CreateEnvironmentRequest{
		Description: to.Ptr("An environment description"),
		DisplayName: to.Ptr("Environment_1"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*ItemsClient) CreateEnvironment

func (client *ItemsClient) CreateEnvironment(ctx context.Context, workspaceID string, createEnvironmentRequest CreateEnvironmentRequest, options *ItemsClientBeginCreateEnvironmentOptions) (ItemsClientCreateEnvironmentResponse, error)

CreateEnvironment - returns ItemsClientCreateEnvironmentResponse in sync mode. This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation].

This API does not support create a environment with definition.

PERMISSIONS THE CALLER MUST HAVE CONTRIBUTOR OR HIGHER WORKSPACE ROLE. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All or Item.ReadWrite.All

LIMITATIONS

  • To create an environment, the workspace must be on a supported Fabric capacity.

MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section.

| Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes |

INTERFACE Generated from API version v1

  • workspaceID - The workspace ID.
  • createEnvironmentRequest - Create item request payload.
  • options - ItemsClientBeginCreateEnvironmentOptions contains the optional parameters for the ItemsClient.BeginCreateEnvironment method.

func (*ItemsClient) DeleteEnvironment

func (client *ItemsClient) DeleteEnvironment(ctx context.Context, workspaceID string, environmentID string, options *ItemsClientDeleteEnvironmentOptions) (ItemsClientDeleteEnvironmentResponse, error)

DeleteEnvironment - PERMISSIONS The caller must have contributor or higher workspace role. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All or Item.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - ItemsClientDeleteEnvironmentOptions contains the optional parameters for the ItemsClient.DeleteEnvironment method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewItemsClient().DeleteEnvironment(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "5b218778-e7a5-4d73-8187-f10824047715", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ItemsClient) GetEnvironment

func (client *ItemsClient) GetEnvironment(ctx context.Context, workspaceID string, environmentID string, options *ItemsClientGetEnvironmentOptions) (ItemsClientGetEnvironmentResponse, error)

GetEnvironment - REQUIRED DELEGATED SCOPES Environment.Read.All or Item.Read.All or Environment.ReadWrite.All or Item.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - ItemsClientGetEnvironmentOptions contains the optional parameters for the ItemsClient.GetEnvironment method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewItemsClient().GetEnvironment(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "41ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Environment = environment.Environment{
	// 	Type: to.Ptr(environment.ItemTypeEnvironment),
	// 	Description: to.Ptr("An Environment description"),
	// 	DisplayName: to.Ptr("Environment_1"),
	// 	ID: to.Ptr("5b218778-e7a5-4d73-8187-f10824047715"),
	// 	WorkspaceID: to.Ptr("cfafbeb1-8037-4d0c-896e-a46fb27ff229"),
	// 	Properties: &environment.PublishInfo{
	// 		PublishDetails: &environment.PublishDetails{
	// 			ComponentPublishInfo: &environment.ComponentPublishInfo{
	// 				SparkLibraries: &environment.SparkLibraries{
	// 					State: to.Ptr(environment.PublishStateSuccess),
	// 				},
	// 				SparkSettings: &environment.SparkSettings{
	// 					State: to.Ptr(environment.PublishStateSuccess),
	// 				},
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-29T14:48:09.069Z"); return t}()),
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-29T14:17:09.069Z"); return t}()),
	// 			State: to.Ptr(environment.PublishStateSuccess),
	// 			TargetVersion: to.Ptr("46838a80-5450-4414-bea0-40fb6f3e0c0d"),
	// 		},
	// 	},
	// }
}
Output:

func (*ItemsClient) ListEnvironments

func (client *ItemsClient) ListEnvironments(ctx context.Context, workspaceID string, options *ItemsClientListEnvironmentsOptions) ([]Environment, error)

ListEnvironments - returns array of Environment from all pages. This API supports pagination [/rest/api/fabric/articles/pagination].

PERMISSIONS The caller must have viewer or higher workspace role.

REQUIRED DELEGATED SCOPES Workspace.Read.All or Workspace.ReadWrite.All

MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section.

| Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes |

INTERFACE Generated from API version v1

  • workspaceID - The workspace ID.
  • options - ItemsClientListEnvironmentsOptions contains the optional parameters for the ItemsClient.NewListEnvironmentsPager method.

func (*ItemsClient) NewListEnvironmentsPager

func (client *ItemsClient) NewListEnvironmentsPager(workspaceID string, options *ItemsClientListEnvironmentsOptions) *runtime.Pager[ItemsClientListEnvironmentsResponse]

NewListEnvironmentsPager - This API supports pagination [/rest/api/fabric/articles/pagination]. PERMISSIONS The caller must have viewer or higher workspace role. REQUIRED DELEGATED SCOPES Workspace.Read.All or Workspace.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE

Generated from API version v1

  • workspaceID - The workspace ID.
  • options - ItemsClientListEnvironmentsOptions contains the optional parameters for the ItemsClient.NewListEnvironmentsPager method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewItemsClient().NewListEnvironmentsPager("cfafbeb1-8037-4d0c-896e-a46fb27ff229", &environment.ItemsClientListEnvironmentsOptions{ContinuationToken: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.Environments = environment.Environments{
		// 	Value: []environment.Environment{
		// 		{
		// 			Type: to.Ptr(environment.ItemTypeEnvironment),
		// 			Description: to.Ptr("A environment description."),
		// 			DisplayName: to.Ptr("Environment_1"),
		// 			ID: to.Ptr("3546052c-ae64-4526-b1a8-52af7761426f"),
		// 			WorkspaceID: to.Ptr("cfafbeb1-8037-4d0c-896e-a46fb27ff229"),
		// 			Properties: &environment.PublishInfo{
		// 				PublishDetails: &environment.PublishDetails{
		// 					ComponentPublishInfo: &environment.ComponentPublishInfo{
		// 						SparkLibraries: &environment.SparkLibraries{
		// 							State: to.Ptr(environment.PublishStateFailed),
		// 						},
		// 						SparkSettings: &environment.SparkSettings{
		// 							State: to.Ptr(environment.PublishStateSuccess),
		// 						},
		// 					},
		// 					EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-30T14:48:09.069Z"); return t}()),
		// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-30T14:17:09.069Z"); return t}()),
		// 					State: to.Ptr(environment.PublishStateFailed),
		// 					TargetVersion: to.Ptr("14ece8b5-68a1-4130-a9e7-074c04537588"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Type: to.Ptr(environment.ItemTypeEnvironment),
		// 			Description: to.Ptr("A environment description."),
		// 			DisplayName: to.Ptr("Environment_2"),
		// 			ID: to.Ptr("a8a1bffa-7eea-49dc-a1d2-6281c1d031f1"),
		// 			WorkspaceID: to.Ptr("cfafbeb1-8037-4d0c-896e-a46fb27ff229"),
		// 			Properties: &environment.PublishInfo{
		// 				PublishDetails: &environment.PublishDetails{
		// 					ComponentPublishInfo: &environment.ComponentPublishInfo{
		// 						SparkLibraries: &environment.SparkLibraries{
		// 							State: to.Ptr(environment.PublishStateSuccess),
		// 						},
		// 						SparkSettings: &environment.SparkSettings{
		// 							State: to.Ptr(environment.PublishStateSuccess),
		// 						},
		// 					},
		// 					EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-29T14:48:09.069Z"); return t}()),
		// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-29T14:17:09.069Z"); return t}()),
		// 					State: to.Ptr(environment.PublishStateSuccess),
		// 					TargetVersion: to.Ptr("46838a80-5450-4414-bea0-40fb6f3e0c0d"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ItemsClient) UpdateEnvironment

func (client *ItemsClient) UpdateEnvironment(ctx context.Context, workspaceID string, environmentID string, updateEnvironmentRequest UpdateEnvironmentRequest, options *ItemsClientUpdateEnvironmentOptions) (ItemsClientUpdateEnvironmentResponse, error)

UpdateEnvironment - PERMISSIONS The caller must have contributor or higher workspace role. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All or Item.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • updateEnvironmentRequest - Update environment request payload.
  • options - ItemsClientUpdateEnvironmentOptions contains the optional parameters for the ItemsClient.UpdateEnvironment method.
Example

Generated from example definition

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/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewItemsClient().UpdateEnvironment(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "5b218778-e7a5-4d73-8187-f10824047715", environment.UpdateEnvironmentRequest{
		Description: to.Ptr("A new description for environment."),
		DisplayName: to.Ptr("Environment_New_Name"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Environment = environment.Environment{
	// 	Type: to.Ptr(environment.ItemTypeEnvironment),
	// 	Description: to.Ptr("A new description for environment."),
	// 	DisplayName: to.Ptr("Environment_New_Name"),
	// 	ID: to.Ptr("5b218778-e7a5-4d73-8187-f10824047715"),
	// 	WorkspaceID: to.Ptr("cfafbeb1-8037-4d0c-896e-a46fb27ff229"),
	// }
}
Output:

type ItemsClientBeginCreateEnvironmentOptions

type ItemsClientBeginCreateEnvironmentOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

ItemsClientBeginCreateEnvironmentOptions contains the optional parameters for the ItemsClient.BeginCreateEnvironment method.

type ItemsClientCreateEnvironmentResponse

type ItemsClientCreateEnvironmentResponse struct {
	// An Environment item.
	Environment
}

ItemsClientCreateEnvironmentResponse contains the response from method ItemsClient.BeginCreateEnvironment.

type ItemsClientDeleteEnvironmentOptions

type ItemsClientDeleteEnvironmentOptions struct {
}

ItemsClientDeleteEnvironmentOptions contains the optional parameters for the ItemsClient.DeleteEnvironment method.

type ItemsClientDeleteEnvironmentResponse

type ItemsClientDeleteEnvironmentResponse struct {
}

ItemsClientDeleteEnvironmentResponse contains the response from method ItemsClient.DeleteEnvironment.

type ItemsClientGetEnvironmentOptions

type ItemsClientGetEnvironmentOptions struct {
}

ItemsClientGetEnvironmentOptions contains the optional parameters for the ItemsClient.GetEnvironment method.

type ItemsClientGetEnvironmentResponse

type ItemsClientGetEnvironmentResponse struct {
	// An Environment item.
	Environment
}

ItemsClientGetEnvironmentResponse contains the response from method ItemsClient.GetEnvironment.

type ItemsClientListEnvironmentsOptions

type ItemsClientListEnvironmentsOptions struct {
	// A token for retrieving the next page of results.
	ContinuationToken *string
}

ItemsClientListEnvironmentsOptions contains the optional parameters for the ItemsClient.NewListEnvironmentsPager method.

type ItemsClientListEnvironmentsResponse

type ItemsClientListEnvironmentsResponse struct {
	// A list of environments.
	Environments
}

ItemsClientListEnvironmentsResponse contains the response from method ItemsClient.NewListEnvironmentsPager.

type ItemsClientUpdateEnvironmentOptions

type ItemsClientUpdateEnvironmentOptions struct {
}

ItemsClientUpdateEnvironmentOptions contains the optional parameters for the ItemsClient.UpdateEnvironment method.

type ItemsClientUpdateEnvironmentResponse

type ItemsClientUpdateEnvironmentResponse struct {
	// An Environment item.
	Environment
}

ItemsClientUpdateEnvironmentResponse contains the response from method ItemsClient.UpdateEnvironment.

type Libraries

type Libraries struct {
	// Custom libraries (.py, .whl, .jar, .tar.gz).
	CustomLibraries *CustomLibraries

	// Feed libraries.
	EnvironmentYml *string
}

Libraries - Environment libraries.

func (Libraries) MarshalJSON

func (l Libraries) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Libraries.

func (*Libraries) UnmarshalJSON

func (l *Libraries) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Libraries.

type PublishDetails

type PublishDetails struct {
	// Environment component publish information.
	ComponentPublishInfo *ComponentPublishInfo

	// End time of publish operation.
	EndTime *time.Time

	// Start time of publish operation.
	StartTime *time.Time

	// Publish state. Additional state types may be added over time.
	State *PublishState

	// Target verion to be published.
	TargetVersion *string
}

PublishDetails - Details of publish operation.

func (PublishDetails) MarshalJSON

func (p PublishDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PublishDetails.

func (*PublishDetails) UnmarshalJSON

func (p *PublishDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PublishDetails.

type PublishInfo

type PublishInfo struct {
	// REQUIRED; Environment publish operation details.
	PublishDetails *PublishDetails
}

PublishInfo - Environment publish information.

func (PublishInfo) MarshalJSON

func (p PublishInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PublishInfo.

func (*PublishInfo) UnmarshalJSON

func (p *PublishInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PublishInfo.

type PublishState

type PublishState string

PublishState - Publish state. Additional state types may be added over time.

const (
	// PublishStateCancelled - Environment publish is in cancelled state.
	PublishStateCancelled PublishState = "Cancelled"
	// PublishStateCancelling - Environment publish is in cancelling state.
	PublishStateCancelling PublishState = "Cancelling"
	// PublishStateFailed - Environment publish is in failed state.
	PublishStateFailed PublishState = "Failed"
	// PublishStateRunning - Environment publish is in running state.
	PublishStateRunning PublishState = "Running"
	// PublishStateSuccess - Environment publish is in success state.
	PublishStateSuccess PublishState = "Success"
	// PublishStateWaiting - Environment publish is in waiting state.
	PublishStateWaiting PublishState = "Waiting"
)

func PossibleEnvironmentPublishStateValues

func PossibleEnvironmentPublishStateValues() []PublishState

PossibleEnvironmentPublishStateValues returns the possible values for the PublishState const type.

type SparkCompute

type SparkCompute struct {
	// Spark driver core.
	DriverCores *int32

	// Spark driver memory.
	DriverMemory *string

	// Dynamic executor allocation.
	DynamicExecutorAllocation *DynamicExecutorAllocationProperties

	// Spark executor core.
	ExecutorCores *int32

	// Spark executor memory.
	ExecutorMemory *string

	// Environment pool has to be a valid custom pool. "Starter Pool" means use starter pool.
	InstancePool *InstancePool

	// Runtime version, find the supported fabric runtimes [/fabric/data-engineering/runtime].
	RuntimeVersion *string

	// Spark properties.
	SparkProperties any
}

func (SparkCompute) MarshalJSON

func (s SparkCompute) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SparkCompute.

func (*SparkCompute) UnmarshalJSON

func (s *SparkCompute) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SparkCompute.

type SparkComputeClient

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

SparkComputeClient contains the methods for the SparkCompute group. Don't use this type directly, use a constructor function instead.

func (*SparkComputeClient) GetPublishedSettings

GetPublishedSettings - PERMISSIONS Read permission to the environment item. REQUIRED DELEGATED SCOPES Environment.Read.All or Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - SparkComputeClientGetPublishedSettingsOptions contains the optional parameters for the SparkComputeClient.GetPublishedSettings method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSparkComputeClient().GetPublishedSettings(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "707cfd07-cbf1-41da-aad7-dd157ddb8c11", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.SparkCompute = environment.SparkCompute{
	// 	DriverCores: to.Ptr[int32](4),
	// 	DriverMemory: to.Ptr("56g"),
	// 	DynamicExecutorAllocation: &environment.DynamicExecutorAllocationProperties{
	// 		Enabled: to.Ptr(false),
	// 		MaxExecutors: to.Ptr[int32](1),
	// 		MinExecutors: to.Ptr[int32](1),
	// 	},
	// 	ExecutorCores: to.Ptr[int32](4),
	// 	ExecutorMemory: to.Ptr("56g"),
	// 	InstancePool: &environment.InstancePool{
	// 		Name: to.Ptr("MyWorkspacePool"),
	// 		Type: to.Ptr(environment.CustomPoolTypeWorkspace),
	// 		ID: to.Ptr("78942136-106c-4f3e-80fc-7ff4eae11603"),
	// 	},
	// 	RuntimeVersion: to.Ptr("1.2"),
	// 	SparkProperties: map[string]any{
	// 		"spark.acls.enable": "false",
	// 	},
	// }
}
Output:

func (*SparkComputeClient) GetStagingSettings

GetStagingSettings - PERMISSIONS Read permission to the environment item. REQUIRED DELEGATED SCOPES Environment.Read.All or Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - SparkComputeClientGetStagingSettingsOptions contains the optional parameters for the SparkComputeClient.GetStagingSettings method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSparkComputeClient().GetStagingSettings(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "707cfd07-cbf1-41da-aad7-dd157ddb8c11", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.SparkCompute = environment.SparkCompute{
	// 	DriverCores: to.Ptr[int32](4),
	// 	DriverMemory: to.Ptr("56g"),
	// 	DynamicExecutorAllocation: &environment.DynamicExecutorAllocationProperties{
	// 		Enabled: to.Ptr(false),
	// 		MaxExecutors: to.Ptr[int32](1),
	// 		MinExecutors: to.Ptr[int32](1),
	// 	},
	// 	ExecutorCores: to.Ptr[int32](4),
	// 	ExecutorMemory: to.Ptr("56g"),
	// 	InstancePool: &environment.InstancePool{
	// 		Name: to.Ptr("MyWorkspacePool"),
	// 		Type: to.Ptr(environment.CustomPoolTypeWorkspace),
	// 		ID: to.Ptr("78942136-106c-4f3e-80fc-7ff4eae11603"),
	// 	},
	// 	RuntimeVersion: to.Ptr("1.2"),
	// 	SparkProperties: map[string]any{
	// 		"spark.acls.enable": "false",
	// 	},
	// }
}
Output:

func (*SparkComputeClient) UpdateStagingSettings

func (client *SparkComputeClient) UpdateStagingSettings(ctx context.Context, workspaceID string, environmentID string, updateEnvironmentSparkComputeRequest UpdateEnvironmentSparkComputeRequest, options *SparkComputeClientUpdateStagingSettingsOptions) (SparkComputeClientUpdateStagingSettingsResponse, error)

UpdateStagingSettings - PERMISSIONS Write permission to the environment item. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • updateEnvironmentSparkComputeRequest - Update environment spark compute request payload.
  • options - SparkComputeClientUpdateStagingSettingsOptions contains the optional parameters for the SparkComputeClient.UpdateStagingSettings method.
Example

Generated from example definition

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/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSparkComputeClient().UpdateStagingSettings(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "707cfd07-cbf1-41da-aad7-dd157ddb8c11", environment.UpdateEnvironmentSparkComputeRequest{
		DriverCores:  to.Ptr[int32](4),
		DriverMemory: to.Ptr("56g"),
		DynamicExecutorAllocation: &environment.DynamicExecutorAllocationProperties{
			Enabled:      to.Ptr(false),
			MaxExecutors: to.Ptr[int32](1),
			MinExecutors: to.Ptr[int32](1),
		},
		ExecutorCores:  to.Ptr[int32](4),
		ExecutorMemory: to.Ptr("56g"),
		InstancePool: &environment.InstancePool{
			Name: to.Ptr("MyWorkspacePool"),
			Type: to.Ptr(environment.CustomPoolTypeWorkspace),
		},
		RuntimeVersion: to.Ptr("1.2"),
		SparkProperties: map[string]any{
			"spark.acls.enable": "false",
			"spark.admin.acls":  nil,
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.SparkCompute = environment.SparkCompute{
	// 	DriverCores: to.Ptr[int32](4),
	// 	DriverMemory: to.Ptr("56g"),
	// 	DynamicExecutorAllocation: &environment.DynamicExecutorAllocationProperties{
	// 		Enabled: to.Ptr(false),
	// 		MaxExecutors: to.Ptr[int32](1),
	// 		MinExecutors: to.Ptr[int32](1),
	// 	},
	// 	ExecutorCores: to.Ptr[int32](4),
	// 	ExecutorMemory: to.Ptr("56g"),
	// 	InstancePool: &environment.InstancePool{
	// 		Name: to.Ptr("MyWorkspacePool"),
	// 		Type: to.Ptr(environment.CustomPoolTypeWorkspace),
	// 		ID: to.Ptr("78942136-106c-4f3e-80fc-7ff4eae11603"),
	// 	},
	// 	RuntimeVersion: to.Ptr("1.2"),
	// 	SparkProperties: map[string]any{
	// 		"spark.acls.enable": "false",
	// 	},
	// }
}
Output:

type SparkComputeClientGetPublishedSettingsOptions

type SparkComputeClientGetPublishedSettingsOptions struct {
}

SparkComputeClientGetPublishedSettingsOptions contains the optional parameters for the SparkComputeClient.GetPublishedSettings method.

type SparkComputeClientGetPublishedSettingsResponse

type SparkComputeClientGetPublishedSettingsResponse struct {
	SparkCompute
}

SparkComputeClientGetPublishedSettingsResponse contains the response from method SparkComputeClient.GetPublishedSettings.

type SparkComputeClientGetStagingSettingsOptions

type SparkComputeClientGetStagingSettingsOptions struct {
}

SparkComputeClientGetStagingSettingsOptions contains the optional parameters for the SparkComputeClient.GetStagingSettings method.

type SparkComputeClientGetStagingSettingsResponse

type SparkComputeClientGetStagingSettingsResponse struct {
	SparkCompute
}

SparkComputeClientGetStagingSettingsResponse contains the response from method SparkComputeClient.GetStagingSettings.

type SparkComputeClientUpdateStagingSettingsOptions

type SparkComputeClientUpdateStagingSettingsOptions struct {
}

SparkComputeClientUpdateStagingSettingsOptions contains the optional parameters for the SparkComputeClient.UpdateStagingSettings method.

type SparkComputeClientUpdateStagingSettingsResponse

type SparkComputeClientUpdateStagingSettingsResponse struct {
	SparkCompute
}

SparkComputeClientUpdateStagingSettingsResponse contains the response from method SparkComputeClient.UpdateStagingSettings.

type SparkLibraries

type SparkLibraries struct {
	// Publish state. Additional state types may be added over time.
	State *PublishState
}

SparkLibraries - Spark libraries.

func (SparkLibraries) MarshalJSON

func (s SparkLibraries) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SparkLibraries.

func (*SparkLibraries) UnmarshalJSON

func (s *SparkLibraries) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SparkLibraries.

type SparkLibrariesClient

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

SparkLibrariesClient contains the methods for the SparkLibraries group. Don't use this type directly, use a constructor function instead.

func (*SparkLibrariesClient) CancelPublish

CancelPublish - PERMISSIONS Write permission for the environment item. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - SparkLibrariesClientCancelPublishOptions contains the optional parameters for the SparkLibrariesClient.CancelPublish method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSparkLibrariesClient().CancelPublish(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "41ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PublishInfo = environment.PublishInfo{
	// 	PublishDetails: &environment.PublishDetails{
	// 		ComponentPublishInfo: &environment.ComponentPublishInfo{
	// 			SparkLibraries: &environment.SparkLibraries{
	// 				State: to.Ptr(environment.PublishStateCancelled),
	// 			},
	// 			SparkSettings: &environment.SparkSettings{
	// 				State: to.Ptr(environment.PublishStateCancelled),
	// 			},
	// 		},
	// 		EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-29T15:00:47.140Z"); return t}()),
	// 		StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-29T15:00:33.435Z"); return t}()),
	// 		State: to.Ptr(environment.PublishStateCancelled),
	// 		TargetVersion: to.Ptr("d9d95b01-248f-4ef4-bd7e-9d3f1f6447be"),
	// 	},
	// }
}
Output:

func (*SparkLibrariesClient) DeleteStagingLibrary

func (client *SparkLibrariesClient) DeleteStagingLibrary(ctx context.Context, workspaceID string, environmentID string, libraryToDelete string, options *SparkLibrariesClientDeleteStagingLibraryOptions) (SparkLibrariesClientDeleteStagingLibraryResponse, error)

DeleteStagingLibrary - PERMISSIONS Write permission for the environment item. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • libraryToDelete - The library file to be deleted. The library name needs to include its extension, for example samplefile.jar.
  • options - SparkLibrariesClientDeleteStagingLibraryOptions contains the optional parameters for the SparkLibrariesClient.DeleteStagingLibrary method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSparkLibrariesClient().DeleteStagingLibrary(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "41ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", "samplelibrary.jar", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SparkLibrariesClient) GetPublishedLibraries

GetPublishedLibraries - PERMISSIONS Read permission for the environment item. REQUIRED DELEGATED SCOPES Environment.Read.All or Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - SparkLibrariesClientGetPublishedLibrariesOptions contains the optional parameters for the SparkLibrariesClient.GetPublishedLibraries method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSparkLibrariesClient().GetPublishedLibraries(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "41ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Libraries = environment.Libraries{
	// 	CustomLibraries: &environment.CustomLibraries{
	// 		JarFiles: []string{
	// 			"samplejar.jar"},
	// 			PyFiles: []string{
	// 				"samplepython.py"},
	// 				RTarFiles: []string{
	// 					"sampleR.tar.gz"},
	// 					WheelFiles: []string{
	// 						"samplewheel-0.18.0-py2.py3-none-any.whl"},
	// 					},
	// 					EnvironmentYml: to.Ptr("dependencies:\r\n- pip:\r\n  - matplotlib==3.4.3"),
	// 				}
}
Output:

func (*SparkLibrariesClient) GetStagingLibraries

GetStagingLibraries - PERMISSIONS Read permission for the environment item. REQUIRED DELEGATED SCOPES Environment.Read.All or Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - SparkLibrariesClientGetStagingLibrariesOptions contains the optional parameters for the SparkLibrariesClient.GetStagingLibraries method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSparkLibrariesClient().GetStagingLibraries(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "41ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Libraries = environment.Libraries{
	// 	CustomLibraries: &environment.CustomLibraries{
	// 		JarFiles: []string{
	// 			"samplejar.jar"},
	// 			PyFiles: []string{
	// 				"samplepython.py"},
	// 				RTarFiles: []string{
	// 					"sampleR.tar.gz"},
	// 					WheelFiles: []string{
	// 						"samplewheel-0.18.0-py2.py3-none-any.whl"},
	// 					},
	// 					EnvironmentYml: to.Ptr("dependencies:\r\n- pip:\r\n  - matplotlib==3.4.3"),
	// 				}
}
Output:

func (*SparkLibrariesClient) PublishEnvironment

PublishEnvironment - PERMISSIONS Write permission for the environment item. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - SparkLibrariesClientPublishEnvironmentOptions contains the optional parameters for the SparkLibrariesClient.PublishEnvironment method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSparkLibrariesClient().PublishEnvironment(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "41ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PublishInfo = environment.PublishInfo{
	// 	PublishDetails: &environment.PublishDetails{
	// 		ComponentPublishInfo: &environment.ComponentPublishInfo{
	// 			SparkLibraries: &environment.SparkLibraries{
	// 				State: to.Ptr(environment.PublishStateRunning),
	// 			},
	// 			SparkSettings: &environment.SparkSettings{
	// 				State: to.Ptr(environment.PublishStateRunning),
	// 			},
	// 		},
	// 		StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-29T14:17:09.069Z"); return t}()),
	// 		State: to.Ptr(environment.PublishStateRunning),
	// 		TargetVersion: to.Ptr("46838a80-5450-4414-bea0-40fb6f3e0c0d"),
	// 	},
	// }
}
Output:

func (*SparkLibrariesClient) UploadStagingLibrary

UploadStagingLibrary - This API allows one file upload at a time. The supported file formats are .jar, .py, .whl, .tar.gz, or environment.yml. LIMITATIONS The maximum request size allowed is 100MB. Network issues may impact the upload size and may result in timeouts. PERMISSIONS Write permission for the environment item. REQUIRED DELEGATED SCOPES Environment.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • environmentID - The environment ID.
  • options - SparkLibrariesClientUploadStagingLibraryOptions contains the optional parameters for the SparkLibrariesClient.UploadStagingLibrary method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/environment"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := environment.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSparkLibrariesClient().UploadStagingLibrary(ctx, "f089354e-8366-4e18-aea3-4cb4a3a50b48", "41ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

type SparkLibrariesClientCancelPublishOptions

type SparkLibrariesClientCancelPublishOptions struct {
}

SparkLibrariesClientCancelPublishOptions contains the optional parameters for the SparkLibrariesClient.CancelPublish method.

type SparkLibrariesClientCancelPublishResponse

type SparkLibrariesClientCancelPublishResponse struct {
	// Environment publish information.
	PublishInfo
}

SparkLibrariesClientCancelPublishResponse contains the response from method SparkLibrariesClient.CancelPublish.

type SparkLibrariesClientDeleteStagingLibraryOptions

type SparkLibrariesClientDeleteStagingLibraryOptions struct {
}

SparkLibrariesClientDeleteStagingLibraryOptions contains the optional parameters for the SparkLibrariesClient.DeleteStagingLibrary method.

type SparkLibrariesClientDeleteStagingLibraryResponse

type SparkLibrariesClientDeleteStagingLibraryResponse struct {
}

SparkLibrariesClientDeleteStagingLibraryResponse contains the response from method SparkLibrariesClient.DeleteStagingLibrary.

type SparkLibrariesClientGetPublishedLibrariesOptions

type SparkLibrariesClientGetPublishedLibrariesOptions struct {
}

SparkLibrariesClientGetPublishedLibrariesOptions contains the optional parameters for the SparkLibrariesClient.GetPublishedLibraries method.

type SparkLibrariesClientGetPublishedLibrariesResponse

type SparkLibrariesClientGetPublishedLibrariesResponse struct {
	// Environment libraries.
	Libraries
}

SparkLibrariesClientGetPublishedLibrariesResponse contains the response from method SparkLibrariesClient.GetPublishedLibraries.

type SparkLibrariesClientGetStagingLibrariesOptions

type SparkLibrariesClientGetStagingLibrariesOptions struct {
}

SparkLibrariesClientGetStagingLibrariesOptions contains the optional parameters for the SparkLibrariesClient.GetStagingLibraries method.

type SparkLibrariesClientGetStagingLibrariesResponse

type SparkLibrariesClientGetStagingLibrariesResponse struct {
	// Environment libraries.
	Libraries
}

SparkLibrariesClientGetStagingLibrariesResponse contains the response from method SparkLibrariesClient.GetStagingLibraries.

type SparkLibrariesClientPublishEnvironmentOptions

type SparkLibrariesClientPublishEnvironmentOptions struct {
}

SparkLibrariesClientPublishEnvironmentOptions contains the optional parameters for the SparkLibrariesClient.PublishEnvironment method.

type SparkLibrariesClientPublishEnvironmentResponse

type SparkLibrariesClientPublishEnvironmentResponse struct {
	// Environment publish information.
	PublishInfo

	// Location contains the information returned from the Location header response.
	Location *string

	// RetryAfter contains the information returned from the Retry-After header response.
	RetryAfter *int32
}

SparkLibrariesClientPublishEnvironmentResponse contains the response from method SparkLibrariesClient.PublishEnvironment.

type SparkLibrariesClientUploadStagingLibraryOptions

type SparkLibrariesClientUploadStagingLibraryOptions struct {
}

SparkLibrariesClientUploadStagingLibraryOptions contains the optional parameters for the SparkLibrariesClient.UploadStagingLibrary method.

type SparkLibrariesClientUploadStagingLibraryResponse

type SparkLibrariesClientUploadStagingLibraryResponse struct {
}

SparkLibrariesClientUploadStagingLibraryResponse contains the response from method SparkLibrariesClient.UploadStagingLibrary.

type SparkSettings

type SparkSettings struct {
	// Publish state. Additional state types may be added over time.
	State *PublishState
}

SparkSettings - Spark settings.

func (SparkSettings) MarshalJSON

func (s SparkSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SparkSettings.

func (*SparkSettings) UnmarshalJSON

func (s *SparkSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SparkSettings.

type UpdateEnvironmentRequest

type UpdateEnvironmentRequest struct {
	// The environment description. Maximum length is 256 characters.
	Description *string

	// The environment display name.
	DisplayName *string
}

UpdateEnvironmentRequest - Update environment request.

func (UpdateEnvironmentRequest) MarshalJSON

func (u UpdateEnvironmentRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateEnvironmentRequest.

func (*UpdateEnvironmentRequest) UnmarshalJSON

func (u *UpdateEnvironmentRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateEnvironmentRequest.

type UpdateEnvironmentSparkComputeRequest

type UpdateEnvironmentSparkComputeRequest struct {
	// Spark driver core.
	DriverCores *int32

	// Spark driver memory.
	DriverMemory *string

	// Dynamic executor allocation.
	DynamicExecutorAllocation *DynamicExecutorAllocationProperties

	// Spark executor core.
	ExecutorCores *int32

	// Spark executor memory.
	ExecutorMemory *string

	// Environment pool has to be a valid custom pool. The name for a default workspace pool is Starter Pool.
	InstancePool *InstancePool

	// Runtime version, find the supported fabric runtimes [/fabric/data-engineering/runtime].
	RuntimeVersion *string

	// Spark properties.
	SparkProperties any
}

func (UpdateEnvironmentSparkComputeRequest) MarshalJSON

func (u UpdateEnvironmentSparkComputeRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateEnvironmentSparkComputeRequest.

func (*UpdateEnvironmentSparkComputeRequest) UnmarshalJSON

func (u *UpdateEnvironmentSparkComputeRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateEnvironmentSparkComputeRequest.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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