1
/* ============================================================================
2
Copyright 2014 Hewlett Packard
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
8
http://www.apache.org/licenses/LICENSE-2.0
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
using System.Collections.Generic;
17
using Openstack.Administration.Domain;
18
using System.Collections;
19
using Openstack.Client.Powershell.Providers.Common;
20
using Openstack.Objects.Domain.Compute;
21
using Openstack.Objects.Domain;
23
using System.Collections.ObjectModel;
24
using Openstack.Objects;
25
using System.Xml.Serialization;
28
namespace Openstack.Client.Powershell.Providers.Compute
30
[RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")]
31
public class ServersUIContainer : BaseUIContainer
33
//=========================================================================================================
37
/// <param name="name"></param>
38
/// <param name="description"></param>
39
/// <param name="path"></param>
40
//=========================================================================================================
41
public ServersUIContainer() { }
42
//=========================================================================================================
46
/// <param name="name"></param>
47
/// <param name="description"></param>
48
/// <param name="path"></param>
49
//=========================================================================================================
50
public ServersUIContainer(BaseUIContainer parentContainer,
54
: base(parentContainer, name, description, path)
56
this.ObjectType = Common.ObjectType.Container;
60
//=========================================================================================================
64
//=========================================================================================================
65
public override void Load()
69
//=========================================================================================================
73
/// <typeparam name="T"></typeparam>
74
/// <returns></returns>
75
//=========================================================================================================
76
private void LoadEntities()
78
IList servers = this.RepositoryFactory.CreateServerRepository().GetServers(null, null, null, null, ServerStatus.Unknown);
79
if (servers != null && servers.Count > 0)
81
this.SetUIContainers<ServerUIContainer>(servers);
82
this.Entities = servers;
86
this.Containers.Clear();
87
this.Entities.Clear();
90
//=========================================================================================================
94
/// <param name="id"></param>
95
/// <returns></returns>
96
//=========================================================================================================
97
public override BaseUIContainer CreateContainer(string id)