Merge "mecm-mepm uninstall playbook added"
[ealt-edge.git] / mecm / mepm / applcm / broker / pkg / handlers / model / model.go
1 /*
2  * Copyright 2020 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package model
17
18 import (
19         _ "github.com/jinzhu/gorm/dialects/mysql"
20 )
21
22 type CreateApplicationReq struct {
23         AppDID                string `yaml:"appDId"`
24         AppInstancename       string `yaml:"appInstancename"`
25         AppInstanceDescriptor string `yaml:"appInstanceDescriptor"`
26 }
27
28 type CreateApplicationRsp struct {
29         AppInstanceID string `yaml:"appInstanceId"`
30 }
31
32 type OnBoardPkgApplicationRsp struct {
33         AppPkgID string `yaml:"appPkgId"`
34 }
35
36 type InstantiateApplicationReq struct {
37         SelectedMECHostInfo struct {
38                 HostName string `yaml:"hostName"`
39                 HostID   string `yaml:"hostId"`
40         } `yaml:"selectedMECHostInfo"`
41 }
42
43 type QueryApplicationInstanceInfoReq struct {
44         Filter            string `yaml:"filter"`
45         AttributeSelector string `yaml:"attributeSelector"`
46 }
47
48 type QueryApplicationLCMOperStatusReq struct {
49         LifecycleOperationOccurrenceID string `yaml:"lifecycleOperationOccurrenceId"`
50 }
51
52 // User represents a user account
53 type AppPackageInfo struct {
54         //gorm.Model
55         ID                 string `gorm:"primary_key;not null;unique"`
56         AppDID             string `yaml:"appDId"`
57         AppProvider        string `yaml:"appProvider"`
58         AppName            string `yaml:"appName"`
59         AppSoftwareVersion string `yaml:"appSoftwareVersion"`
60         AppDVersion        string `yaml:"appDVersion"`
61         OnboardingState    string `yaml:"onboardingState"`
62         DeployType         string `yaml:"deployType"`
63         AppPackage         string `yaml:"appPackage"`
64 }
65
66 // Task represents a task for the user
67 type AppInstanceInfo struct {
68         //gorm.Model
69         ID                     string `gorm:"primary_key;not null;unique"`
70         AppInstanceName        string `yaml:"appInstanceName"`
71         AppInstanceDescription string `yaml:"appInstanceDescription"`
72         AppDID                 string `yaml:"appDId"`
73         AppProvider            string `yaml:"appProvider"`
74         AppName                string `yaml:"appName"`
75         AppSoftVersion         string `yaml:"appSoftVersion"`
76         AppDVersion            string `yaml:"appDVersion"`
77         AppPkgID               string `yaml:"appPkgId"`
78         InstantiationState     string `yaml:"instantiationState"`
79         Host                   string `yaml:"host"`
80         WorkloadID             string `yaml:"workloadId"`
81         InstantiatedAppState   string `yaml:"instantiatedAppState"`
82 }