CLI 설정

IBM Cloud Schematics 명령줄 플러그인을 사용하여 인프라 프로비저닝 프로세스, 리소스 구성 및 앱 워크로드 배포를 자동화할 수 있습니다. IBM Cloud® Schematics 명령행은 다음 플랫폼 아키텍처를 지원합니다.

  • Mac OS X 64비트
  • Mac OS arm64
  • Windows™ 64비트
  • Windows™ 32비트
  • Linux™ 64비트
  • Linux™ arm64
  • Linux™ 32비트
  • PowerLinux™ 64비트
  • System/390 Linux™ 64비트

IBM Cloud 명령행 설치

필요한 명령행을 설치하여 IBM Cloud Schematics 사용을 시작하십시오.

  1. IBM Cloud CLI를 설치하십시오.

    명령행을 자주 사용할 계획이십니까? IBM Cloud 명령행에 쉘 자동 완성 사용(Linux/MacOS만 해당)을 시도하십시오.

  2. IBM Cloud에 로그인하십시오. 프롬프트가 표시되면 IBM Cloud 인증 정보를 입력하십시오.

    ibmcloud login
    

    연합 ID가 있는 경우에는 ibmcloud login --sso를 사용하여 IBM Cloud CLI에 로그인하십시오. 사용자 이름을 입력하고 명령행 출력에 제공된 URL을 사용하여 일회성 패스코드를 검색하십시오. --sso 옵션을 사용하지 않으면 로그인에 실패하고 --sso 옵션을 사용하면 성공하는 경우에는 연합 ID를 보유하고 있다는 것입니다.

IBM Cloud Schematics 명령행 플러그인 설치

IBM Cloud Schematics 플러그인을 설치하여 클라우드 운영, 구성 관리 및 인프라 배포를 자동화하세요. Cloud Shell에 Schematics 플러그인을 설치할 수도 있습니다.

  1. IBM Cloud용 Schematics 명령행 플러그인을 설치하십시오.

    ibmcloud plugin install schematics
    
  2. IBM Cloud Schematics 명령행 플러그인이 성공적으로 설치되었는지 확인하십시오. 이 플러그인은 schematics로 나열됩니다.

    ibmcloud plugin list
    

    출력 예

    Listing installed plug-ins...
    
    Plugin Name                             Version      Status             Private endpoints supported
    schematics[sch]                           1.12.28   Update Available                     true
    
  3. 지원되는 모든 명령을 나열하여 Schematics 명령행 플러그인을 사용할 수 있는지 확인하십시오. Schematics 명령행 플러그인에 대해 작업하기 위한 명령 접두부는 ibmcloud schematics입니다.

    ibmcloud schematics help
    

    출력 예

    NAME:
    ibmcloud schematics - Automate the deployment and management of IBM Cloud resources using Infrastructure as Code
    
    USAGE:
    ibmcloud schematics command [arguments...] [command options]
    
    COMMANDS:
    action, ac           Create and manage Schematics actions. Action let you define the source control repository that contains your playbook yamls etc. and pass environment-specific variables.
    agent, ag            Create and manage agents. Visit 'https://cloud.ibm.com/docs/schematics?topic=schematics-agents-intro' to know more about agents.
    apply                Apply a plan to an workspace to deploy the latest version of your configuration.
    destroy              Destroy resources in an existing workspace. This action cannot be reversed.
    inventory, iv        Create and manage Schematics Inventories. Inventory let you define host group that can contain INI or Resource Query id's
    job, j               Create and manage Schematics jobs. Job let you manage all the jobs like creating/deleting/updating/retrieving.
    kms                  listing and enabling IBM Cloud Schematics kms instances and root keys.
    logs                 Show details about actions that ran against an workspace.
    output               Get all the output values from your workspace; (ex. result of terraform output command
    plan                 Create a plan for an workspace. Plans show how resources would change if you applied the latest version of your workspace configuration.
    policy, plcy         Create and manage policies. Policies tell Schematics which agent it should use to execute Terraform and Ansible jobs in a specific network zone.
    refresh              Refresh the workspace with latest version of your workspace configuration.
    resource-query, rq   Create and manage Schematics Resource Query. Resource query let you define conditions to fetch host group that can be used to perform actions
    state                Advanced state management
    version              Report version information about the IBM Cloud Schematics CLI.
    workspace, ws        Create and manage workspaces. Workspaces let you define the source control repository that contains your Terraform configuration and pass workspace-specific variables.
    help, h              Show help
    
    Enter 'ibmcloud schematics help [command]' for more information about a command.
    

CLI 업데이트

새로운 기능에 액세스하려면 IBM Cloud 명령행 및 Schematics 명령행 플러그인을 주기적으로 업데이트하십시오.

  1. IBM Cloud CLI를 업데이트하십시오.

  2. IBM Cloud에 로그인하십시오. 프롬프트가 표시되면 IBM Cloud 인증 정보를 입력하십시오.

    ibmcloud login
    

    연합 ID가 있는 경우에는 ibmcloud login --sso를 사용하여 IBM Cloud CLI에 로그인하십시오. 사용자 이름을 입력하고 명령행 출력에 제공된 URL을 사용하여 일회성 패스코드를 검색하십시오. --sso를 사용하지 않으면 로그인에 실패하고 --sso 옵션 사용 시 성공하면 연합 ID가 있는 것입니다.

  3. Schematics 명령행 플러그인에 대한 업데이트가 사용 가능한지 확인하십시오. 업데이트가 사용 가능한 경우 명령행 출력에서 Update available 알림을 찾을 수 있습니다.

    ibmcloud plugin list | grep schematics
    

    출력 예

    schematics                      1.12.28        Update Available           false
    
  4. Schematics 명령행 플러그인을 업데이트하십시오.

    Schematics 에이전트의 경우, Schematics 플러그인 버전은 1.12.12 버전보다 높아야 합니다.

    ibmcloud plugin update schematics
    
    ibmcloud plugin list | grep schematics
    

    출력 예

    schematics[sch]                      1.12.29        true
    
  5. Schematics 플러그인을 표시합니다.

    ibmcloud plugin show schematics
    

    출력 예

    Plugin Name              Version   Status   Private endpoints supported
    schematics[sch]          1.12.29            true
    
    Commands:
    schematics,sch                                 Automate the deployment and management of IBM Cloud resources using Infrastructure as Code
    schematics,sch plan                            Create a plan for an workspace. Plans show how resources would change if you applied the latest version of your workspace configuration.
    schematics,sch version                         Report version information about the IBM Cloud Schematics CLI.
    schematics,sch logs                            Show details about actions that ran against an workspace.
    schematics,sch output                          Get all the output values from your workspace; (ex. result of terraform output command
    schematics,sch destroy                         Destroy resources in an existing workspace. This action cannot be reversed.
    schematics,sch refresh                         Refresh the workspace with latest version of your workspace configuration.
    schematics,sch apply                           Apply a plan to an workspace to deploy the latest version of your configuration.
    schematics,sch job,j                           Create and manage Schematics jobs. Job let you manage all the jobs like creating/deleting/updating/retrieving.
    schematics,sch job,j run                       Run a job in IBM Cloud Schematics to work with your Schematics entities like workspaces/actions.
    schematics,sch job,j get                       Get information about a job.
    ....
    schematics,sch workspace,ws upload             Upload a tar file to a workspace from the IBM Cloud Schematics service.
    schematics,sch workspace,ws commands           Run one or more terraform commands
    schematics,sch workspace,ws taint              Marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply
    schematics,sch workspace,ws untaint            Unmarks a Terraform-managed resource as tainted, restoring it as the primary instance in the state
    schematics,sch workspace,ws state              Advanced state management
    schematics,sch workspace,ws import             Run a job to import existing resources into workspace
    schematics,sch inventory,iv                    Create and manage Schematics Inventories. Inventory let you define host group that can contain INI or Resource Query id's
    schematics,sch inventory,iv create             Create an Inventory in IBM Cloud Schematics to pass to Schematics action for target host groups
    schematics,sch inventory,iv update             Update an Inventory in IBM Cloud Schematics with all new detail
    schematics,sch inventory,iv get                Get information about an inventory
    schematics,sch inventory,iv list               List all existing inventories in targeted account
    schematics,sch inventory,iv delete             Delete an inventory from the IBM Cloud Schematics service
    schematics,sch agent,ag                        Create and manage agents. Visit 'https://cloud.ibm.com/docs/schematics?topic=schematics-agents-intro' to know more about agents.
    schematics,sch agent,ag create                 Create an agent in IBM Cloud Schematics.
    schematics,sch agent,ag validate,plan          Run validate to create a prerequisite scan that analyses agent and cluster configuration before deploying your agent.
    schematics,sch agent,ag deploy,apply           Run deploy to deploy your agent on the configured cluster.
    schematics,sch agent,ag get                    View the details of an agent.
    schematics,sch agent,ag list                   List all agents in your IBM Cloud account.
    schematics,sch agent,ag update                 Update your agent details. Updating agent does not re-validate or re-deploy your agent.
    schematics,sch agent,ag health                 Run health to perform a health check on your deployed agent.
    schematics,sch agent,ag delete                 Delete an agent.
    schematics,sch agent,ag destroy                Destroy the resources associated with agent deployment
    schematics,sch action,ac                       Create and manage Schematics actions. Action let you define the source control repository that contains your playbook yamls etc. and pass environment-specific variables.
    schematics,sch action,ac create                Create an action in IBM Cloud Schematics to work with your Ansible configuration in source control.
    schematics,sch action,ac get                   Get information about an action.
    schematics,sch action,ac list                  List all existing actions in this account.
    schematics,sch action,ac delete                Delete an action from the IBM Cloud Schematics service.
    schematics,sch action,ac update                Update the details of an existing action.
    schematics,sch action,ac upload                Upload TAR file to an action from the IBM Cloud Schematics service
    

IBM Cloud Schematics 명령행 플러그인 설치 제거

IBM Cloud Schematics 플러그인을 설치 제거하여 로컬 시스템에서 Schematics 플러그인을 제거하십시오.

  1. Schematics용 IBM Cloud 명령행 플러그인을 설치 제거하십시오.

    ibmcloud plugin uninstall schematics
    

    출력 예

    Uninstalling plug-in 'schematics'...
    OK
    Plug-in 'schematics' was successfully uninstalled.
    
  2. IBM Cloud Schematics 명령줄 플러그인이 성공적으로 제거되었는지 확인합니다.

    ibmcloud plugin list | grep schematics