Get-SimanAwsServer⚓︎
SYNOPSIS⚓︎
Obtiene los servidores asignados a la plataforma Siman Cloud en AWS.
SYNTAX⚓︎
Get-SimanAwsServer [[-Name] <String[]>] [-Environment <String[]>] [-Filter <Hashtable>] [-IncludeUsage]
[<CommonParameters>]
DESCRIPTION⚓︎
Regresa una colección de objectos de tipo [Siman.Cloud.AWS.Server] con el detalle de las instancias de servidor en la plataforma AWS.
Se puede especificar una lista de nombres a buscar correspondientes al Environment especificado.
Adicionalmete se puede proporcionar un filtro basado en las distintas propiedades o tags de la plataforma EC2 de AWS.
Ver Example 3.
COMMAND ALIASES
- gaws
- Get-CloudSimanServer
EXAMPLES⚓︎
Example 1 - Todos los servidores del entorno Production⚓︎
PS> Get-SimanAwsServer -Environment Production
Example 2 - Busca una lista de servidores por nombre⚓︎
PS> Get-SimanAwsServer -Name SMNAWSRB01, SMNAWSRB02 -IncludeUsage
Name IP Address State Memory CPU OS Disk Group Role Environment Instance Id
Free
---- ---------- ----- ------ --- ---------- ----- ---- ----------- -----------
SMNAWSRB02 10.10.12.5 running 52% 1% 15.61 GB Infrastructure RDCore Production i-0e62638d841585389
SMNAWSRB01 10.10.2.5 running 51% 1% 14.43 GB Infrastructure RDCore Production i-095ac5dc35707fa62
Example 3 - Filtro avanzado⚓︎
PS> Get-SimanAwsServer -Filter @{'tag:Role' = 'RDGW'; 'tag:Status' = 'Sentry'}
Name IP Address State Group Role Environment Instance Id
---- ---------- ----- ----- ---- ----------- -----------
SMNAWSGW01 10.10.11.190 running Infrastructure RDGW Production i-0077bfc6bbf298cb6
SMNAWSGW04 10.10.1.38 running Infrastructure RDGW Production i-023b8f4803f2b5be4
Define un filtro en base a los tags incluidos en las instancias a buscar. En este caso se obtienen los servidores con rol RDGW y marcados como Sentry.
PARAMETERS⚓︎
-Name⚓︎
Uno o más nombres de servidor a buscar.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-Environment⚓︎
Filtra las instancias en el entorno específicado (Production | Testing | Prep | Retired).
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Filter⚓︎
Hashtable con las propiedades de las instancias EC2 a incluir. Para filtrar por tags se debe incluir el prefijo tag: en el nombre de la propiedad, ejemplo: @{ 'tag:Role' = 'RDGW' }.
Estos filtros deben cumplir los lineamientos de las API de AWS: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html#Filtering_Resources_CLI
Type: System.Collections.Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: @{}
Accept pipeline input: False
Accept wildcard characters: False
-IncludeUsage⚓︎
Incluye en el resultado los datos de uso en tiempo real de CPU, Memoria y Disco.
Solamente agregar este parametro en caso necesario, ya que es un proceso tardado la obtencion de las metricas en tiempo real.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters⚓︎
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS⚓︎
String⚓︎
Acepta los nombres de servidor canalizados mediante el pipeline.
OUTPUTS⚓︎
Siman.Cloud.AWS.Server⚓︎
NOTES⚓︎
Se elimino el uso de caches ya que no aportaba ningun beneficio de desempeño en el comando, por lo que mejor se opto por agregar un parametro adicional para obtener los datos de uso del servidor, el cual es un proceso tardado.