Beispiel #1
0
            /// <summary>
            /// Initializes a new instance of the <see cref="CreateServerDetails"/> class
            /// with the specified details.
            /// </summary>
            /// <param name="name">Name of the new server.</param>
            /// <param name="imageName">The image to use for the new server instance. This is
            /// specified as an image ID (see <see cref="SimpleServerImage.Id"/>) or a full URL.</param>
            /// <param name="flavorId">The flavor to use for the new server instance. This
            /// is specified as a flavor ID (see <see cref="Flavor.Id"/>) or a full URL.</param>
            /// <param name="adminPass">The root Password </param>
            /// <param name="keyName">the ssh keyname to add to server</param>
            /// <param name="securityGroupNames">A collection of openstack security group name</param>
            /// <param name="attachVolumeIds">A collection of voiume ids which will be attached to the instance.</param>
            /// <param name="diskConfig">The disk configuration. If the value is <see langword="null"/>, the default configuration for the specified image is used.</param>
            /// <param name="metadata">The metadata to associate with the server.</param>
            /// <param name="personality">A collection of <see cref="Personality"/> objects describing the paths and contents of files to inject in the target file system during the creation process. If the value is <see langword="null"/>, no files are injected.</param>
            /// <param name="accessIPv4">The behavior of this value is unspecified. Do not use.</param>
            /// <param name="accessIPv6">The behavior of this value is unspecified. Do not use.</param>
            /// <param name="networks">A collection of identifiers for networks to initially connect to the server. These are obtained from <see cref="CloudNetwork.Id">CloudNetwork.Id</see></param>
            public CreateServerDetails(string name, string imageName, string flavorId, string adminPass, string keyName, string[] securityGroupNames, string[] attachVolumeIds, DiskConfiguration diskConfig, Dictionary <string, string> metadata, string accessIPv4, string accessIPv6, IEnumerable <string> networks, IEnumerable <Personality> personality)
            {
                Name        = name;
                ImageId     = imageName;
                FlavorId    = flavorId;
                DiskConfig  = diskConfig;
                Metadata    = metadata;
                AccessIPv4  = accessIPv4;
                AccessIPv6  = accessIPv6;
                Networks    = (networks == null ? null : networks.Select(i => new NewServerNetwork(i)).ToArray());
                Personality = personality != null?personality.ToArray() : null;

                KeyName             = keyName;
                SecurityGroupNames  = SecurityGroupName.GetGroupNamesFromStrings(securityGroupNames).ToArray <SecurityGroupName>();
                BlockDeviceMappings = VolumeIds.GetVolumeIdsFromStrings(attachVolumeIds).ToArray <VolumeIds>();
                AdminPass           = adminPass;
            }