dataset

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusInit         = "INIT"
	StatusCreating     = "CREATING"
	StatusStarting     = "STARTING"
	StatusStopping     = "STOPPING"
	StatusDeleting     = "DELETING"
	StatusRunning      = "RUNNING"
	StatusStopped      = "STOPPED"
	StatusSnapshotting = "SNAPSHOTTING"
	StatusCreateFailed = "CREATE_FAILED"
	StatusStartFailed  = "START_FAILED"
	StatusDeleteFailed = "DELETE_FAILED"
	StatusError        = "ERROR"
	StatusDeleted      = "DELETED"
	StatusFrozen       = "FROZEN"
)

Variables

View Source
var RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

func Delete

func Delete(c *golangsdk.ServiceClient, id string) *golangsdk.ErrResult

func List

func List(c *golangsdk.ServiceClient, opts ListOpts) (*pagination.Pager, error)

func Update

func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) *golangsdk.ErrResult

Types

type AnnotationFile

type AnnotationFile struct {
	CreateTime int               `json:"create_time"`
	DatasetId  string            `json:"dataset_id"`
	Depth      int               `json:"depth"`
	FileName   string            `json:"file_Name"`
	FileId     string            `json:"file_id"`
	FileType   string            `json:"file_type"`
	Height     int               `json:"height"`
	Size       int               `json:"size"`
	Tags       map[string]string `json:"tags"`
	Url        string            `json:"url"`
	Width      int               `json:"width"`
}

type CreateOpts

type CreateOpts struct {
	DataFormat           string                `json:"data_format,omitempty"`
	DataSources          []DataSource          `json:"data_sources,omitempty"`
	DatasetName          string                `json:"dataset_name" required:"true"`
	DatasetType          int                   `json:"dataset_type,omitempty"`
	Description          string                `json:"description,omitempty"`
	ImportAnnotations    *bool                 `json:"import_annotations,omitempty"`
	ImportData           bool                  `json:"import_data,omitempty"`
	LabelFormat          LabelFormat           `json:"label_format,omitempty"`
	Labels               []Label               `json:"labels,omitempty"`
	Managed              bool                  `json:"managed,omitempty"`
	Schema               []Field               `json:"schema,omitempty"`
	WorkPath             string                `json:"work_path" required:"true"`
	WorkPathType         int                   `json:"work_path_type"`
	WorkforceInformation *WorkforceInformation `json:"workforce_information,omitempty"`
	WorkspaceId          string                `json:"workspace_id,omitempty"`
}

type CreateResp

type CreateResp struct {
	DatasetId    string `json:"dataset_id"`
	ErrorCode    string `json:"error_code"`
	ErrorMsg     string `json:"error_msg"`
	ImportTaskId string `json:"import_task_id"`
}

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*CreateResp, error)

type DataSource

type DataSource struct {
	DataPath         string      `json:"data_path,omitempty"`
	DataType         int         `json:"data_type,omitempty"`
	SchemaMaps       []SchemaMap `json:"schema_maps,omitempty"`
	SourceInfo       SourceInfo  `json:"source_info,omitempty"`
	WithColumnHeader *bool       `json:"with_column_header,omitempty"`
}

type Dataset

type Dataset struct {
	AnnotatedSampleCount    int                    `json:"annotated_sample_count"`
	AnnotatedSubSampleCount int                    `json:"annotated_sub_sample_count"`
	ContentLabeling         bool                   `json:"content_labeling"`
	CreateTime              int                    `json:"create_time"`
	CurrentVersionId        string                 `json:"current_version_id"`
	CurrentVersionName      string                 `json:"current_version_name"`
	DataFormat              string                 `json:"data_format"`
	DataSources             []DataSource           `json:"data_sources"`
	DataStatistics          map[string]interface{} `json:"data_statistics"`
	DataUpdateTime          int                    `json:"data_update_time"`
	DatasetFormat           int                    `json:"dataset_format"`
	DatasetId               string                 `json:"dataset_id"`
	DatasetName             string                 `json:"dataset_name"`
	DatasetTags             []string               `json:"dataset_tags"`
	DatasetType             int                    `json:"dataset_type"`
	DatasetVersionCount     int                    `json:"dataset_version_count"`
	DeletedSampleCount      int                    `json:"deleted_sample_count"`
	DeletionStats           map[string]int         `json:"deletion_stats"`
	Description             string                 `json:"description"`
	EnterpriseProjectId     string                 `json:"enterprise_project_id"`
	ExistRunningTask        bool                   `json:"exist_running_task"`
	ExistWorkforceTask      bool                   `json:"exist_workforce_task"`
	FeatureSupports         []string               `json:"feature_supports"`
	ImportData              bool                   `json:"import_data"`
	ImportTaskId            string                 `json:"import_task_id"`
	InnerAnnotationPath     string                 `json:"inner_annotation_path"`
	InnerDataPath           string                 `json:"inner_data_path"`
	InnerLogPath            string                 `json:"inner_log_path"`
	InnerTaskPath           string                 `json:"inner_task_path"`
	InnerTempPath           string                 `json:"inner_temp_path"`
	InnerWorkPath           string                 `json:"inner_work_path"`
	LabelTaskCount          int                    `json:"label_task_count"`
	Labels                  []Label                `json:"labels"`
	LoadingSampleCount      int                    `json:"loading_sample_count"`
	Managed                 bool                   `json:"managed"`
	NextVersionNum          int                    `json:"next_version_num"`
	RunningTasksId          []string               `json:"running_tasks_id"`
	Schema                  []Field                `json:"schema"`
	Status                  int                    `json:"status"`
	ThirdPath               string                 `json:"third_path"`
	TotalSampleCount        int                    `json:"total_sample_count"`
	TotalSubSampleCount     int                    `json:"total_sub_sample_count"`
	UnconfirmedSampleCount  int                    `json:"unconfirmed_sample_count"`
	UpdateTime              int                    `json:"update_time"`
	Versions                []Version              `json:"versions"`
	WorkPath                string                 `json:"work_path"`
	WorkPathType            int                    `json:"work_path_type"`
	WorkforceDescriptor     []WorkforceDescriptor  `json:"workforce_descriptor"`
	WorkforceTaskCount      int                    `json:"workforce_task_count"`
	WorkspaceId             string                 `json:"workspace_id"`
}

func Get

func Get(c *golangsdk.ServiceClient, id string, opts GetOpts) (*Dataset, error)

type Dataset4List

type Dataset4List struct {
	Dataset
	DataUrl string           `json:"data_url"`
	Samples []AnnotationFile `json:"samples"`
}

func ExtractDatasets

func ExtractDatasets(r pagination.Page) ([]Dataset4List, error)

type DatasetPage

type DatasetPage struct {
	pagination.OffsetPageBase
}

func (DatasetPage) IsEmpty

func (b DatasetPage) IsEmpty() (bool, error)

IsEmpty checks whether a RouteTablePage struct is empty.

type Field

type Field struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name,omitempty"`
	SchemaId    int    `json:"schema_id,omitempty"`
	Type        string `json:"type,omitempty"`
}

type GetOpts

type GetOpts struct {
	CheckRunningTask bool `q:"check_running_task,omitempty"`
	RunningTaskType  *int `q:"running_task_type,omitempty"`
}

type Label

type Label struct {
	Attributes []LabelAttribute `json:"attributes,omitempty"`
	Name       string           `json:"name,omitempty"`
	Property   LabelProperty    `json:"property,omitempty"`
	Type       *int             `json:"type,omitempty"`
}

type LabelAttribute

type LabelAttribute struct {
	DefaultValue string              `json:"default_value,omitempty"`
	Id           string              `json:"id,omitempty"`
	Name         string              `json:"name,omitempty"`
	Type         string              `json:"type,omitempty"`
	Values       LabelAttributeValue `json:"values,omitempty"`
}

type LabelAttributeValue

type LabelAttributeValue struct {
	Id    string `json:"id,omitempty"`
	Value string `json:"value,omitempty"`
}

type LabelFormat

type LabelFormat struct {
	LabelType           string `json:"label_type,omitempty"`
	TextLabelSeparator  string `json:"text_label_separator,omitempty"`
	TextSampleSeparator string `json:"text_sample_separator,omitempty"`
}

type LabelProperty

type LabelProperty struct {
	Color        string `json:"@modelarts:color,omitempty"`
	DefaultShape string `json:"@modelarts:default_shape,omitempty"`
	FromType     string `json:"@modelarts:from_type,omitempty"`
	RenameTo     string `json:"@modelarts:rename_to,omitempty"`
	Shortcut     string `json:"@modelarts:shortcut,omitempty"`
	ToType       string `json:"@modelarts:to_type,omitempty"`
}

type LabelStats

type LabelStats struct {
	Attributes  []LabelAttribute `json:"attributes"`
	Count       int              `json:"count"`
	Name        string           `json:"name"`
	Property    LabelProperty    `json:"property"`
	SampleCount int              `json:"sample_count"`
	Type        int              `json:"type"`
}

type ListOpts

type ListOpts struct {
	CheckRunningTask   bool   `q:"check_running_task,omitempty"`
	ContainVersions    *bool  `q:"contain_versions,omitempty"`
	DatasetType        *int   `q:"dataset_type,omitempty"`
	FilePreview        bool   `q:"file_preview,omitempty"`
	Limit              *int   `q:"limit,omitempty"`
	Offset             int    `q:"offset,omitempty"`
	Order              string `q:"order,omitempty"`
	RunningTaskType    *int   `q:"running_task_type,omitempty"`
	SearchContent      string `q:"search_content,omitempty"`
	SortBy             string `q:"sort_by,omitempty"`
	SupportExport      bool   `q:"support_export,omitempty"`
	TrainEvaluateRatio string `q:"train_evaluate_ratio,omitempty"`
	VersionFormat      *int   `q:"version_format,omitempty"`
	WithLabels         bool   `q:"with_labels,omitempty"`
	WorkspaceId        string `q:"workspace_id,omitempty"`
}

type ListResp

type ListResp struct {
	Result []Dataset4List `json:"datasets"`
	Total  int            `json:"total_number"`
}

type SchemaMap

type SchemaMap struct {
	DestName string `json:"dest_name,omitempty"`
	SrcName  string `json:"src_name,omitempty"`
}

type SourceInfo

type SourceInfo struct {
	ClusterId    string `json:"cluster_id,omitempty"`
	ClusterMode  string `json:"cluster_mode,omitempty"`
	ClusterName  string `json:"cluster_name,omitempty"`
	DatabaseName string `json:"database_name,omitempty"`
	Input        string `json:"input,omitempty"`
	Ip           string `json:"ip,omitempty"`
	Port         string `json:"port,omitempty"`
	QueueName    string `json:"queue_name,omitempty"`
	SubnetId     string `json:"subnet_id,omitempty"`
	TableName    string `json:"table_name,omitempty"`
	UserName     string `json:"user_name,omitempty"`
	UserPassword string `json:"user_password,omitempty"`
	VpcId        string `json:"vpc_id,omitempty"`
}

type UpdateOpts

type UpdateOpts struct {
	AddLabels        []Label `json:"add_labels,omitempty"`
	CurrentVersionId string  `json:"current_version_id,omitempty"`
	DatasetName      string  `json:"dataset_name,omitempty"`
	DeleteLabels     []Label `json:"delete_labels,omitempty"`
	Description      *string `json:"description,omitempty"`
	UpdateLabels     []Label `json:"update_labels,omitempty"`
}

type Version

type Version struct {
	AddSampleCount               int                    `json:"add_sample_count"`
	AnalysisCachePath            string                 `json:"analysis_cache_path"`
	AnalysisStatus               int                    `json:"analysis_status"`
	AnalysisTaskId               string                 `json:"analysis_task_id"`
	AnnotatedSampleCount         int                    `json:"annotated_sample_count"`
	AnnotatedSubSampleCount      int                    `json:"annotated_sub_sample_count"`
	ClearHardProperty            bool                   `json:"clear_hard_property"`
	Code                         string                 `json:"code"`
	CreateTime                   int                    `json:"create_time"`
	Crop                         bool                   `json:"crop"`
	CropPath                     string                 `json:"crop_path"`
	CropRotateCachePath          string                 `json:"crop_rotate_cache_path"`
	DataAnalysis                 map[string]interface{} `json:"data_analysis"`
	DataPath                     string                 `json:"data_path"`
	DataStatistics               map[string]interface{} `json:"data_statistics"`
	DataValidate                 bool                   `json:"data_validate"`
	DeletedSampleCount           int                    `json:"deleted_sample_count"`
	DeletionStats                map[string]int         `json:"deletion_stats"`
	Description                  string                 `json:"description"`
	ExportImages                 bool                   `json:"export_images"`
	ExtractSerialNumber          bool                   `json:"extract_serial_number"`
	IncludeDatasetData           bool                   `json:"include_dataset_data"`
	IsCurrent                    bool                   `json:"is_current"`
	LabelStats                   []LabelStats           `json:"label_stats"`
	LabelType                    string                 `json:"label_type"`
	ManifestCacheInputPath       string                 `json:"manifest_cache_input_path"`
	ManifestPath                 string                 `json:"manifest_path"`
	Message                      string                 `json:"message"`
	ModifiedSampleCount          int                    `json:"modified_sample_count"`
	PreviousAnnotatedSampleCount int                    `json:"previous_annotated_sample_count"`
	PreviousTotalSampleCount     int                    `json:"previous_total_sample_count"`
	PreviousVersionId            string                 `json:"previous_version_id"`
	ProcessorTaskId              string                 `json:"processor_task_id"`
	ProcessorTaskStatus          int                    `json:"processor_task_status"`
	RemoveSampleUsage            bool                   `json:"remove_sample_usage"`
	Rotate                       bool                   `json:"rotate"`
	RotatePath                   string                 `json:"rotate_path"`
	SampleState                  string                 `json:"sample_state"`
	StartProcessorTask           bool                   `json:"start_processor_task"`
	Status                       int                    `json:"status"`
	Tags                         []string               `json:"tags"`
	TaskType                     int                    `json:"task_type"`
	TotalSampleCount             int                    `json:"total_sample_count"`
	TotalSubSampleCount          int                    `json:"total_sub_sample_count"`
	TrainEvaluateSampleRatio     string                 `json:"train_evaluate_sample_ratio"`
	UpdateTime                   int                    `json:"update_time"`
	VersionFormat                string                 `json:"version_format"`
	VersionId                    string                 `json:"version_id"`
	VersionName                  string                 `json:"version_name"`
	WithColumnHeader             bool                   `json:"with_column_header"`
}

type Worker

type Worker struct {
	CreateTime  *int   `json:"create_time,omitempty"`
	Description string `json:"description,omitempty"`
	Email       string `json:"email,omitempty"`
	Role        *int   `json:"role,omitempty"`
	Status      *int   `json:"status,omitempty"`
	UpdateTime  *int   `json:"update_time,omitempty"`
	WorkerId    string `json:"worker_id,omitempty"`
	WorkforceId string `json:"workforce_id,omitempty"`
}

type WorkforceConfig

type WorkforceConfig struct {
	Workers       []Worker `json:"workers,omitempty"`
	WorkforceId   string   `json:"workforce_id,omitempty"`
	WorkforceName string   `json:"workforce_name,omitempty"`
}

type WorkforceDescriptor

type WorkforceDescriptor struct {
	CurrentTaskId                 string   `json:"current_task_id"`
	CurrentTaskName               string   `json:"current_task_name"`
	RejectNum                     int      `json:"reject_num"`
	Repetition                    int      `json:"repetition"`
	IsSynchronizeAutoLabelingData bool     `json:"is_synchronize_auto_labeling_data"`
	IsSynchronizeData             bool     `json:"is_synchronize_data"`
	Workers                       []Worker `json:"workers"`
	WorkforceId                   string   `json:"workforce_id"`
	WorkforceName                 string   `json:"workforce_name"`
}

type WorkforceInformation

type WorkforceInformation struct {
	DataSyncType                *int             `json:"data_sync_type,omitempty"`
	Repetition                  int              `json:"repetition,omitempty"`
	SynchronizeAutoLabelingData *bool            `json:"synchronize_auto_labeling_data,omitempty"`
	SynchronizeData             *bool            `json:"synchronize_data,omitempty"`
	TaskId                      string           `json:"task_id,omitempty"`
	TaskName                    string           `json:"task_name" required:"true"`
	WorkforcesConfig            WorkforcesConfig `json:"workforces_config,omitempty"`
}

type WorkforcesConfig

type WorkforcesConfig struct {
	Agency     string            `json:"agency,omitempty"`
	Workforces []WorkforceConfig `json:"workforces,omitempty"`
}

Jump to

Keyboard shortcuts

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