spmigration

package
v0.1.57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: GPL-2.0 Imports: 20 Imported by: 0

README

SLES Service Pack Migration Engine - jobchecker

This is a service pack migration engine for SUSE Linux Enterprise Server (SLES) Service Pack (SP) migration written in Go.

Systems from given groups could be migrated to the next service pack.

Reason choosing Go over Python is the concurrency capabilities and stabilities I experienced. Additionally Go is a compiled language and the binary is statically linked. This makes it easy to deploy the binary to any Linux systems.

Pre-requisites:

  • SUSE Manager / Uyuni v.4.3.6 or higher
  • Salt-master running on SLES 15 or higher
  • SMTP (e.g. postfix) where jobchecker is running must be configured to allow sending emails to the recipients
  • Port 12345 for local or remote access should be open on the firewall
  • Jobchecker must run as local root user

Concept:

The one binary jobchecker is listening at port 12345 for HTTP requests. The program uses xmlrpc api to call SUSE Manager. On the other hand side jobchecker uses salt tornado rest api to execute salt state, runner and execution modules.

The name jobchecker was originally founded at the time when I started it for checking update and reboot jobs periodically. Over time I added more features to it. Now it is a bulk migration engine but can also be used for mass update and patching workflows.

The workflow at a glance:

  • service pack migration for given groups in SUSE Manager.
  • email notification with tracking file information.
  • salt-run presence check to identify really online salt minions.
  • create a group of "qualified" systems in SUSE Manager for better management.
  • salt grains check if btrfs root disk has enough free space.
  • exclude systems by predefined no_upgrade grains key.
  • run service pack pre-migration salt states.
  • assigne predefined software channels to systems in order to apply latest updates.
  • update systems with latest updates of newly assigned software channels.
  • reboot systems after update.
  • run package refresh.
  • run service pack migration dry-run.
  • run service pack migration, using ident and base channel with optional channels.
  • schedule system reboot.
  • run analyze cycle workflow. This workflow re-run above steps for jobs which were pending or failed in the first run.
  • email notification about analyze cycle workflow tracking file.
  • run salt state to set certain values e.g. patch level, service pack level, etc. (customer requirement, for cmdb etc.)
  • run service pack post-migration salt states.
  • run reporting - use salt state to generate a csv report for the online systems of given groups.
  • email notification about final system status and reporting files.

Disqualified systems will get a "note" message recorded under the system -> Notes in SUSE Manager so that the reason is also visible in SUMA UI.

During the workflow cycles admins can watch the tracking file or via web browser e.g. http://sumahostname:12345/query_spmigration?filename=/var/log/sumapatch/spmigration_myuser_20231001134029.yaml

systemd service for jobchecker

Jobchecker runs as a systemd service. jobchecker.service

The suma-jobchecker runs non-stop. Upone received HTTP requests it will processes the requests in sub-routines concurrently. If no any job is in the queue then only health check is running every 10 seconds.

Inside the service file, you need to

  • change the path to the binary and the path to the config file.
  • change the Enrivonment variable SUMAKEY to your own key. This key is used to decrypt and encrypt the password value in the SUSE Manager configuration file.
  • change the path of templates to your own path. Examples: templates
  • change the interval to your own interval.

SUMA Configuration and Password encryption

The password is encrypted with the key (SUMAKEY) provided in the systemd service file. The key is used to decrypt the password value.

To encrypt the password, you can use the following command: https://github.com/bjin01/salt-sap-patching/blob/master/encrypt.py

python3.6 encrypt.py <YOUR-PASSWD>

Output:

Randomly generated key! Keep it safely!: 
taZk-X-MRuUSB-xYAzPys41Hi0X1iFDf0wBWynLTodw=

Save this encrypted password in your configuration file.
gAAAAABlGn1RxFaE9rRVJqVRehxTIJ6sPxPSSFuEvW4GGzmEXpT_b39D6yAQx5Us_FLLsthgUInR0UE0TPl79yf5Dsv-MNM0Bw==

With the encrypted password and the key, you can create the configuration file. Example:

SUSE Manager configuration file:

cat /etc/salt/master.d/suma.conf 
suma_api:
  suma1.bo2go.home:
    username: 'admin'
    password: gAAAAABj_xzeu23IpzKM-mYOYO
    email_to:
      - bo.jin@example.com
    healthcheck_interval: 10
    healthcheck_email:
      - bo.jin@example.com

Run spmigration

In order to start the spmigration workflow which in turn is a HTTP POST Request sent to jobchecker a salt runner module was created. It takes a given configuration file as input parameter.

The runner module needs to be placed runners directory on salt master node. e.g. /srv/salt/_runners/get_spmigration_targets.py

salt-run start_spmigration.run config=/srv/salt/spmigration/spmigration_config.yaml

If jobchecker is not running on the same host as SUSE Manager then you need to specify the api_server parameter.

salt-run start_spmigration.run config=/srv/salt/spmigration/spmigration_config.yaml api_server='192.168.122.23'

Configuration file

The configuration file is a yaml file. Example: spmigration_config.yaml

# The configuration file for spmigration
groups:
- testgrp
qualifying_only: true
delay: 1
timeout: 3
gather_job_timeout: 15
logfile: "/var/log/patching/sumapatching.log"
salt_master_address: 192.168.122.23
salt_api_port: 8000
salt_user: mysalt
salt_password: mytest
salt_diskspace_grains_key: btrfs:for_patching
salt_diskspace_grains_value: ok
salt_no_upgrade_exception_key: no_patch
salt_no_upgrade_exception_value: 'true'
salt_prep_state: orch.prepatch_states
salt_post_state: orch.postpatch_states
jobchecker_timeout: 20
reboot_timeout: 50
jobchecker_emails:
- bo.jin@example.com
- bo.jin@example.com
t7user: t7udp
authentication_token: R2bfp223Qsk-pX970Jw8tyJUChT4-e2J8anZ4G4n4IM=
tracking_file_directory: "/var/log/sumapatch/"
patch_level: 2023-Q5
include_spmigration: true
assigne_channels:
- assigne_channel:
    current_base_channel: mytest-prd-sle-product-sles_sap15-sp4-pool-x86_64
    new_base_prefix: mytest-test-
- assigne_channel:
    current_base_channel: mysle15sp3-prd-sle-product-sles15-sp3-pool-x86_64
    new_base_prefix: ''
products:
- product:
    ident: '1565,1576,1609,1592,1572,1616,1580,935,1633,1614'
    name: SUSE Linux Enterprise Server for SAP Applications 15 SP5 x86_64
    base_channel_label: sle-product-sles_sap15-sp5-pool-x86_64
    clm_project_label: mysap15sp5
    optionalChildChannels:
      - rke2-sles15sp5
- product:
    ident: '1396,1423,1431,1411,1415,935,1403,1438'
    name: SUSE Linux Enterprise Server 15 SP4 x86_64
    base_channel_label: sle-product-sles15-sp4-pool-x86_64
    clm_project_label:
    optionalChildChannels:
      - rke2-sles15sp4
      - rke2-common-15sp4

Now let's go through the configuration file.

groups

The groups parameter is a list of groups in SUSE Manager. The systems in these groups will be migrated to the next service pack.

qualifying_only

The qualifying_only parameter is a boolean value. If it is set to true then the workflow only checks if the systems have valid migration targets or not. Admins need to read the log file to see the result. If it is set to false then the workflow will continue to run the whole workflow.

delay

The delay parameter is an integer value. It is used to delay the job start. The delay is in minutes.

timeout

The timeout parameter is an integer value. This parameter is used in the salt-run manage.status timeout= and gather_job_timeout= parameters. The timeout is in seconds. If number of systems is high and salt minion take more time to respond then one might consider to increase this value.

gather_job_timeout

The gather_job_timeout parameter is an integer value. This parameter is used in the salt-run manage.status gather_job_timeout= parameter. The timeout is in seconds. If number of systems is high and salt minion take more time to respond then one might consider to increase this value.

logfile

The logfile parameter is a string value. This parameter is used to specify the log file path.

salt_master_address

The salt_master_address parameter is a string value. This parameter is used to specify the salt master address.

salt_api_port

The salt_api_port parameter is an integer value. This parameter is used to specify the salt api port.

salt_user

The salt_user parameter is a string value. This parameter is used to specify the salt user. The salt user is defined in the salt master configuration file. e.g.

external_auth:
  file:
    ^filename: /etc/salt/master.d/susemanager-users.txt
    ^hashtype: sha512
    admin:
      - .*
      - '@wheel'
      - '@runner'
      - '@jobs'
  sharedsecret:
    mysalt:
       - .*
       - '@wheel'
       - '@runner'
       - '@jobs'
salt_password

The password for the mysalt user is stored in a file called /etc/salt/master.d/sharedsecret.conf

sharedsecret: mytest
salt_diskspace_grains_key

The salt_diskspace_grains_key parameter is a string value. This parameter is used to specify the salt grains key name for the disk space check. The name will be used in the salt grains.get function.

salt_diskspace_grains_value

The salt_diskspace_grains_value parameter is a string value. This parameter is used to specify the salt grains value for the disk space check. The value will be used in the salt grains.get function. If the grains.get result key value match the pre-defined value then the system is qualified for the migration. A note will be recorded under the system -> Notes in SUSE Manager.

salt_no_upgrade_exception_key

The salt_no_upgrade_exception_key parameter is a string value. This parameter is used to specify the salt grains key name for the no_upgrade exception. The name will be used in the salt grains.get function. If the grains.get result key value match the pre-defined value then the system is not qualified for the migration. A note will be recorded under the system -> Notes in SUSE Manager.

salt_no_upgrade_exception_value

The salt_no_upgrade_exception_value parameter is a string value. This parameter is used to specify the salt grains value for the no_upgrade exception. The value will be used in the salt grains.get function. If the grains.get result key value match the pre-defined value then the system is not qualified for the migration. A note will be recorded under the system -> Notes in SUSE Manager.

salt_prep_state

The salt_prep_state parameter is a string value. This parameter is used to specify the salt state for the pre-migration tasks. The state will be executed via salt state.apply. Within the state one can define To-Do's that are needed to prepare the system. e.g. stop some heavy running processes, etc.

salt_post_state

The salt_post_state parameter is a string value. This parameter is used to specify the salt state for the post-migration tasks. The state will be executed via salt state.apply. Within the state one can define To-Do's that are needed to clean up the system. e.g. start some heavy running processes, etc.

jobchecker_timeout

The jobchecker_timeout parameter is an integer value. This parameter is used to specify the timeout for the jobchecker api call. The timeout is in minutes. This timeout will be used in the jobcheck loops for update and spmigration jobs. After timeout the workflow will continue with next steps. For systems which jobs are still pending the status will be recorded.

reboot_timeout

The reboot_timeout parameter is an integer value. This parameter is used to specify the timeout for the reboot job. The timeout is in minutes. This timeout will be used in the jobcheck loops for reboot jobs. After timeout the workflow will continue with next steps.

jobchecker_emails

The jobchecker_emails parameter is a list of email addresses. This parameter is used to specify the email addresses for the jobchecker api call. The email addresses will be used in the jobchecker api call. At beginning and after the workflow is finished the jobchecker will send an email to the email recipients.

t7user

This is a customer specific parameter to indicate which admin user is running the workflow. The value will be used in the tracking file.

authentication_token

The authentication_token parameter is a string value. This parameter is used to specify the authentication token for the jobchecker api call. The authentication token will be used in the jobchecker api call. The authentication token is used to authenticate the caller.

tracking_file_directory

The tracking_file_directory parameter is a string value. This parameter is used to specify the tracking file directory. The tracking file directory will be used to store the tracking file. The purpose of this tracking file is to allow admins to follow the status of the systems while workflow is running. This file will be rewritten by jobchecker.

patch_level

This is a customer specific parameter. The value of this parameter will be used in a built-in salt execution module to set the patch level of the system.

include_spmigration

The include_spmigration parameter is a boolean value. If it is set to true then the workflow will run the spmigration workflow. If it is set to false then the workflow will not run the spmigration workflow. This is useful if admins want to run the workflow for update and patching only.

assigne_channels
assigne_channels:
- assigne_channel:
    current_base_channel: mytest-prd-sle-product-sles_sap15-sp4-pool-x86_64
    new_base_prefix: mytest-test-

In this section admins can define the channels for the systems to assigne to. The systems will be assigned to the channels if the current_base_channel matches the system base channel.

current_base_channel: must have the parent channel label of the original SUSE vendor channel. e.g. sle-product-sles15-sp4-pool-x86_64

The new_base_prefix can have the value e.g. "myclm-test-" myclm is the content lifecycle management project label. test is the environment label. This value will be prepended to the current_base_channel and all child channels. Be careful to not forget the dash at the end of the prefix.

If new_base_prefix is left empty then the original SUSE vendor parent and child channels will be assigned if the system not already has the channels.

Make sure all child channels the systems need are available under the new parent channel.

You can define multiple assigne_channel sections to match systems with different base channels in the given groups.

The channels will be used to apply latest updates/patches before running service pack migration. It is recommended to update the system as much as possible before running service pack migration. If a system has not been patched for more than 3 months then the service pack migration might fail because certain bugs have been fixed in the latest patches.

products
products:
- product:
    ident: '1565,1576,1609,1592,1572,1616,1580,935,1633,1614'
    name: SUSE Linux Enterprise Server for SAP Applications 15 SP5 x86_64
    base_channel_label: sle-product-sles_sap15-sp5-pool-x86_64
    clm_project_label: mysap15sp5
    optionalChildChannels:
      - rke2-sles15sp5

In this section admins can define the products (service packs) for the systems to migrate to. The systems will be migrated to the product if the given ident matches the system product ident that SUSE Manager detects.

The ident value holds IDs that match to the varios products that each system has. The ident value of every system within SUSE Manager can be obtained by a script I wrote.

https://github.com/bjin01/salt-sap-patching/blob/master/srv/salt/_runners/get_spmigration_targets.py

    salt-run get_spmigration_targets.list_targets groups="a_group1 testgrp"

The output will be ident values and products names that will be needed in order to define the products section in the configuration file.

- ident: [1563,1609,1602,1592,1572,1584,1580,935], friendly: [base: SUSE Linux Enterprise Server 15 SP5 x86_64, addon: SUSE Linux Enterprise Live Patching 15 SP5 x86_64, Public Cloud Module 15 SP5 x86_64, Web and Scripting Module 15 SP5 x86_64, Basesystem Module 15 SP5 x86_64, Containers Module 15 SP5 x86_64, Server Applications Module 15 SP5 x86_64, SUSE Manager Client Tools for SLE 15 x86_64]
- ident: [1563,1609,1602,1592,1572,1584,1580,935,1633], friendly: [base: SUSE Linux Enterprise Server 15 SP5 x86_64, addon: SUSE Linux Enterprise Live Patching 15 SP5 x86_64, Public Cloud Module 15 SP5 x86_64, Web and Scripting Module 15 SP5 x86_64, Basesystem Module 15 SP5 x86_64, Containers Module 15 SP5 x86_64, Server Applications Module 15 SP5 x86_64, SUSE Manager Client Tools for SLE 15 x86_64, Python 3 Module 15 SP5 x86_64]

The ident value in the configuration file does not need the [] brackets. The ident value is a string value.

The name value is a string value. The name value is the base product name.

The base_channel_label value is a string value. The base channel label is the parent channel label of the original SUSE vendor channel. e.g. sle-product-sles15-sp4-pool-x86_64

The clm_project_label value is a string value. This value is the content lifecycle management project label. This value will be prepended to the environment label and base_channel_label including all child channels.

If the clm_project_label is left empty then the original SUSE vendor parent and child channels will be assigned if the system not already has the channels.

The optionalChildChannels value is a list of string values. This value is the optional child channels of the base channel. The child channels will be assigned to the systems. Make sure all child channels the systems need are available under the new parent channel. We don't check if the channels exist under the new parent channel. If the channels do not exist then these channels will not be assigned to the systems.

Email notification

The email notification is a feature that sends email to the recipients at the beginning and at the end of the workflow. The email contains the tracking file information. The tracking file is a yaml file. The tracking file is used to record the status of the systems during the workflow. The tracking file is located in the tracking_file_directory. The tracking file name is generated by the jobchecker. The tracking file name is in the format of spmigration__.yaml

The email content is generated by a template. The template is located in the templates directory. The directory is specified in the jobchecker systemd service file.

Command overview

To get the migration target ident:

salt-run get_spmigration_targets.list_targets target_system=minion_name

To get unique migration target ident for all systems in a suma group:

salt-run get_spmigration_targets.list_targets groups="spmigration_test"
-------------------------------------------------------------------------

It is good to delete squid cache before starting spmigration:
salt -N sumaproxy state.apply squid.delete_cache

-------------------------------------------------------------------------

To start spmigration run:

salt-run start_spmigration.run config=spmigration_config.yaml
-------------------------------------------------------------------------

To create single btrfs snapshot for a group of systems (suma)
salt-run btrfs_snapshot.create_single groups="testgrp"

-------------------------------------------------------------------------

Configuration file:
/srv/salt/base/spmigration/spmigration_config.yaml

if this parameter is set true then only target ident validation is run. 
qualifying_only: true

-------------------------------------------------------------------------

There is a bash script that will rollback snapshot to the one before spmigration. 
Nodes must be rebooted after snapshot rollback.
In SUMA the nodes must perform pkg list refresh after reboot.

btrfs_rollback.sh
-------------------------------------------------------------------------

Delete  spmigration_t7*  groups in SUSE Manager. This is a cleanup step.

salt-run get_spmigration_targets.delete_groups

-------------------------------------------------------------------------

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add_Note

func Add_Note(sessionkey *auth.SumaSessionKey, sid int, subject string, note string) error

func Contains

func Contains(s []int, e int) bool

func Convert_String_IntSlices

func Convert_String_IntSlices(mystring string) []int

func Convert_String_to_maps

func Convert_String_to_maps(mystring string) map[string]string

func Convert_to_ISO8601_DateTime

func Convert_to_ISO8601_DateTime(date time.Time) string

func Delete_Notes

func Delete_Notes(sessionkey *auth.SumaSessionKey, sid int) error

func Discart_lable

func Discart_lable(label string) string

func Find_MigrationTarget

func Find_MigrationTarget(sessionkey *auth.SumaSessionKey, minionid int, UserData *Migration_Groups) (ident string, migrate_base_channel string)

This func is for finding the migration target for each minion at the beginning of the migration process. If no proper migration target is found the minion will be excluded from further processing.

func Get_Active_Minions_in_Group

func Get_Active_Minions_in_Group(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups) []int

func Get_salt_online_Minions_in_Group

func Get_salt_online_Minions_in_Group(sessionkey *auth.SumaSessionKey, minion_list []string, groupsdata *Migration_Groups) []string

func Orchestrate

func Orchestrate(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups, sumahost string, email_template_dir string, health *bool)

func Parse_Product_info

func Parse_Product_info(inputString string)

Types

type AddOrRemoveSystems_Request

type AddOrRemoveSystems_Request struct {
	Sessionkey      string `xmlrpc:"sessionKey"`
	SystemGroupName string `xmlrpc:"systemGroupName"`
	ServerIds       []int  `xmlrpc:"serverIds"`
	Add             bool   `xmlrpc:"add"`
}

type AddOrRemoveSystems_Response

type AddOrRemoveSystems_Response struct {
	Result_ID int
}

type Add_Note_Request

type Add_Note_Request struct {
	Sessionkey string `xmlrpc:"sessionKey"`
	Sid        int    `xmlrpc:"sid"`
	Subject    string `xmlrpc:"subject"`
	Body       string `xmlrpc:"body"`
}

type All_Minions_In_Group

type All_Minions_In_Group struct {
	Minion_List map[string][]string
}

type Array

type Array struct {
	Data Data `xml:"data"`
}

type Array_ActiveSystems_in_Group

type Array_ActiveSystems_in_Group struct {
	Data Data_ActiveSystems_in_Group `xml:"data"`
}

type Assigne_Channel

type Assigne_Channel struct {
	Current_base_channel string `xmlrpc:"current_base_channel"`
	New_base_prefix      string `xmlrpc:"new_base_prefix"`
}

type Assigne_Channels_Job

type Assigne_Channels_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Change_Channels_Request

type Change_Channels_Request struct {
	Sessionkey         string    `xmlrpc:"sessionKey"`
	Sid                int       `xmlrpc:"sid"`
	BaseChannelLabel   string    `xmlrpc:"baseChannelLabel"`
	ChildLabels        []string  `xmlrpc:"childLabels"`
	EarliestOccurrence time.Time `xmlrpc:"earliestOccurrence"`
}

type ContentSource

type ContentSource struct {
	Id        int    `xmlrpc:"id,omitempty"`
	Label     string `xmlrpc:"label,omitempty"`
	SourceUrl string `xmlrpc:"sourceUrl,omitempty"`
	Type      string `xmlrpc:"type,omitempty"`
}

type Create_SPMigration_Group_Request

type Create_SPMigration_Group_Request struct {
	Sessionkey  string `xmlrpc:"sessionKey"`
	Name        string `xmlrpc:"name"`
	Description string `xmlrpc:"description"`
}

type Create_SPMigration_Group_Response

type Create_SPMigration_Group_Response struct {
	Server_group struct {
		Id           int    `xmlrpc:"id"`
		Name         string `xmlrpc:"name"`
		Description  string `xmlrpc:"description"`
		Org_id       int    `xmlrpc:"org_id"`
		System_count int    `xmlrpc:"system_count"`
	} `xmlrpc:"server group"`
}

type CustomTime

type CustomTime struct {
	time.Time
}

func (*CustomTime) UnmarshalXML

func (c *CustomTime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Data

type Data struct {
	Values []Struct `xml:"value>struct"`
}

type Data_ActiveSystems_in_Group

type Data_ActiveSystems_in_Group struct {
	Values []int `xml:"value>i4"`
}

type Delete_Notes_Request

type Delete_Notes_Request struct {
	Sessionkey string `xmlrpc:"sessionKey"`
	Sid        int    `xmlrpc:"sid"`
}

type Email_job_info

type Email_job_info struct {
	Jobinfo []map[int]string
}

func (*Email_job_info) Send_Job_Response_Email

func (e *Email_job_info) Send_Job_Response_Email(email_job email.Job_Email_Body)

type Generic_Job_Response

type Generic_Job_Response struct {
	JobID int `xmlrpc:"id"`
}

type Get_Channels_Request

type Get_Channels_Request struct {
	Sessionkey string `xmlrpc:"sessionKey"`
	Sid        int    `xmlrpc:"sid"`
}

type Get_Channels_Response

type Get_Channels_Response struct {
	Result []struct {
		Id                   int             `xmlrpc:"id,omitempty"`
		Name                 string          `xmlrpc:"name,omitempty"`
		Label                string          `xmlrpc:"label,omitempty"`
		Arch_name            string          `xmlrpc:"arch_name,omitempty"`
		Arch_label           string          `xmlrpc:"arch_label,omitempty"`
		Summary              string          `xmlrpc:"summary,omitempty"`
		Description          string          `xmlrpc:"description,omitempty"`
		Checksum_label       string          `xmlrpc:"checksum_label,omitempty"`
		Last_modified        time.Time       `xmlrpc:"last_modified,omitempty"`
		Maintainer_name      string          `xmlrpc:"maintainer_name,omitempty"`
		Maintainer_email     string          `xmlrpc:"maintainer_email,omitempty"`
		Maintainer_phone     string          `xmlrpc:"maintainer_phone,omitempty"`
		Support_policy       string          `xmlrpc:"support_policy,omitempty"`
		Gpg_key_url          string          `xmlrpc:"gpg_key_url,omitempty"`
		Gpg_key_id           string          `xmlrpc:"gpg_key_id,omitempty"`
		Gpg_key_fp           string          `xmlrpc:"gpg_key_fp,omitempty"`
		Yumrepo_last_sync    time.Time       `xmlrpc:"yumrepo_last_sync,omitempty"`
		End_of_life          string          `xmlrpc:"end_of_life,omitempty"`
		Parent_channel_label string          `xmlrpc:"parent_channel_label,omitempty"`
		Clone_original       string          `xmlrpc:"clone_original,omitempty"`
		ContentSources       []ContentSource `xmlrpc:"contentSources,omitempty"`
	}
}

type Get_System_by_Group_Request

type Get_System_by_Group_Request struct {
	Sessionkey string `xmlrpc:"sessionKey"`
	GroupName  string `xmlrpc:"systemGroupName"`
}

type Get_Upgradable_Packages_Request

type Get_Upgradable_Packages_Request struct {
	Sessionkey string `xmlrpc:"sessionKey"`
	Sid        int    `xmlrpc:"systemId"`
}

type Get_Upgradable_Packages_Response

type Get_Upgradable_Packages_Response struct {
	Result []struct {
		Name          string `xmlrpc:"name,omitempty"`
		From_release  string `xmlrpc:"from_release,omitempty"`
		To_epoch      string `xmlrpc:"to_epoch,omitempty"`
		Arch          string `xmlrpc:"arch,omitempty"`
		To_package_id int    `xmlrpc:"to_package_id,omitempty"`
		From_version  string `xmlrpc:"from_version,omitempty"`
		To_version    string `xmlrpc:"to_version,omitempty"`
		From_arch     string `xmlrpc:"from_arch,omitempty"`
		To_arch       string `xmlrpc:"to_arch,omitempty"`
		From_epoch    string `xmlrpc:"from_epoch,omitempty"`
		To_release    string `xmlrpc:"to_release,omitempty"`
	}
}

type Host_Job_Info

type Host_Job_Info struct {
	Assigne_Channels_Job     Assigne_Channels_Job     `json:"Assigne_Channels_Job"`
	Pkg_Refresh_Job          Pkg_Refresh_Job          `json:"Pkg_Refresh_Job"`
	Update_Pkg_Job           Update_Pkg_Job           `json:"Update_Pkg_Job"`
	Reboot_Pre_MigrationJob  Reboot_Pre_MigrationJob  `json:"Reboot_Pre_MigrationJob"`
	SP_Migration_DryRun_Job  SP_Migration_DryRun_Job  `json:"SP_Migration_DryRun_Job"`
	SP_Migration_Job         SP_Migration_Job         `json:"SP_Migration_Job"`
	Reboot_Post_MigrationJob Reboot_Post_MigrationJob `json:"Reboot_Post_MigrationJob"`
	Channel_Environment      string                   `json:"Channel_Environment"`
}

type InnerValue

type InnerValue struct {
	StringValue   *string     `xml:"string,omitempty"`
	IntegerValue  *int        `xml:"i4,omitempty"`
	Int           *int        `xml:"int,omitempty"`
	DateTimeValue *CustomTime `xml:"dateTime.iso8601,omitempty"`
	BooleanValue  *bool       `xml:"bool,omitempty"`
}

func (InnerValue) GetFieldValue

func (v InnerValue) GetFieldValue() interface{}

type Job_Chain

type Job_Chain struct {
	SP_Migration_Hosts []Host_Job_Info
}

type ListAllChannels_Request

type ListAllChannels_Request struct {
	Sessionkey string `xmlrpc:"sessionKey"`
}

type ListAllChannels_Response

type ListAllChannels_Response struct {
	Result []struct {
		Id            int    `xmlrpc:"id,omitempty"`
		Name          string `xmlrpc:"name,omitempty"`
		Label         string `xmlrpc:"label,omitempty"`
		Arch_name     string `xmlrpc:"arch_name,omitempty"`
		Provider_name string `xmlrpc:"provider_name,omitempty"`
		Packages      int    `xmlrpc:"packages,omitempty"`
		Systems       int    `xmlrpc:"systems,omitempty"`
	}
}

func List_All_Channels

func List_All_Channels(sessionkey *auth.SumaSessionKey) *ListAllChannels_Response

type ListMigrationTarget_Request

type ListMigrationTarget_Request struct {
	Sessionkey                          string `xmlrpc:"sessionKey"`
	Sid                                 int    `xmlrpc:"sid"`
	ExcludeTargetWhereMissingSuccessors bool   `xmlrpc:"excludeTargetWhereMissingSuccessors"`
}

type ListMigrationTarget_Response

type ListMigrationTarget_Response struct {
	Result []struct {
		Ident    string `xmlrpc:"ident,omitempty"`
		Friendly string `xmlrpc:"friendly,omitempty"`
	}
}

type ListSystemInJobs

type ListSystemInJobs struct {
	ListInProgressSystems ListSystemInJobs_Response
	ListFailedSystems     ListSystemInJobs_Response
	ListCompletedSystems  ListSystemInJobs_Response
}

func (*ListSystemInJobs) List_Completed_Systems

func (c *ListSystemInJobs) List_Completed_Systems(sessionkey *auth.SumaSessionKey, jobid_pkg_update int)

func (*ListSystemInJobs) List_Failed_Systems

func (c *ListSystemInJobs) List_Failed_Systems(sessionkey *auth.SumaSessionKey, jobid_pkg_update int)

func (*ListSystemInJobs) List_InProgress_Systems

func (c *ListSystemInJobs) List_InProgress_Systems(sessionkey *auth.SumaSessionKey, jobid_pkg_update int)

type ListSystemInJobs_Request

type ListSystemInJobs_Request struct {
	Sessionkey string `xmlrpc:"sessionKey"`
	ActionId   int    `xmlrpc:"actionId"`
}

type ListSystemInJobs_Response

type ListSystemInJobs_Response struct {
	Result []struct {
		Server_name  string
		Base_channel string
		Server_id    int
		Timestamp    time.Time
	}
}

type Member

type Member struct {
	Name  string     `xml:"name"`
	Value InnerValue `xml:"value"`
}

type MethodResponse

type MethodResponse struct {
	Params Params `xml:"params"`
}

type MethodResponse_ActiveSystems_in_Group

type MethodResponse_ActiveSystems_in_Group struct {
	Params Params_ActiveSystems_in_Group `xml:"params"`
}

type Migration_Groups

type Migration_Groups struct {
	Groups                          []string `json:"groups"`
	Qualifying_only                 bool     `json:"qualifying_only"`
	Delay                           int      `json:"delay"`
	Timeout                         int      `json:"timeout"`
	GatherJobTimeout                int      `json:"gather_job_timeout"`
	Logfile                         string   `json:"logfile"`
	SaltMaster_Address              string   `json:"salt_master_address"`
	SaltApi_Port                    int      `json:"salt_api_port"`
	SaltUser                        string   `json:"salt_user"`
	SaltPassword                    string   `json:"salt_password"`
	Salt_diskspace_grains_key       string   `json:"salt_diskspace_grains_key"`
	Salt_diskspace_grains_value     string   `json:"salt_diskspace_grains_value"`
	Salt_no_upgrade_exception_key   string   `json:"salt_no_upgrade_exception_key"`
	Salt_no_upgrade_exception_value string   `json:"salt_no_upgrade_exception_value"`
	Salt_Prep_State                 string   `json:"salt_prep_state"`
	Salt_Post_State                 string   `json:"salt_post_state"`
	JobcheckerTimeout               int      `json:"jobchecker_timeout"`
	Reboot_timeout                  int      `json:"reboot_timeout"`
	JobcheckerEmails                []string `json:"jobchecker_emails"`
	Patch_Level                     string   `json:"patch_level"`
	Include_Spmigration             bool     `json:"include_spmigration"`
	T7User                          string   `json:"t7user"`
	Token                           string   `json:"authentication_token"`
	Tracking_file_directory         string   `json:"tracking_file_directory"`
	Assigne_channels                []struct {
		Assigne_Channel Assigne_Channel `json:"assign_channel"`
	} `json:"assign_channels"`

	Target_Products []struct {
		Product Target_Product `json:"product"`
	} `json:"products"`
}

type Minion_Data

type Minion_Data struct {
	Minion_ID                int           `json:"Minion_ID"`
	Minion_Name              string        `json:"Minion_Name"`
	Host_Job_Info            Host_Job_Info `json:"Host_Job_Info"`
	Migration_Stage          string        `json:"Migration_Stage"`
	Migration_Stage_Status   string        `json:"Migration_Stage_Status"`
	Target_base_channel      string        `json:"Target_base_channel"`
	Target_Ident             string        `json:"Target_Ident"`
	Target_Optional_Channels []string      `json:"Target_Optional_Channels"`
}

func (*Minion_Data) Get_Upgradable_Packages

func (m *Minion_Data) Get_Upgradable_Packages(sessionkey *auth.SumaSessionKey)

type OptionalChannel

type OptionalChannel struct {
	Old_Channel string `xmlrpc:"old_channel"`
	New_Channel string `xmlrpc:"new_channel"`
}

type Param

type Param struct {
	Value Value `xml:"value"`
}

type Param_ActiveSystems_in_Group

type Param_ActiveSystems_in_Group struct {
	Value Value_ActiveSystems_in_Group `xml:"value"`
}

type Params

type Params struct {
	Param Param `xml:"param"`
}

type Params_ActiveSystems_in_Group

type Params_ActiveSystems_in_Group struct {
	Param Param_ActiveSystems_in_Group `xml:"param"`
}

type Pkg_Refresh_Job

type Pkg_Refresh_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Reboot_Post_MigrationJob

type Reboot_Post_MigrationJob struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Reboot_Pre_MigrationJob

type Reboot_Pre_MigrationJob struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type SP_Migration_DryRun_Job

type SP_Migration_DryRun_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type SP_Migration_Job

type SP_Migration_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type SchedulePackageUpdates_Request

type SchedulePackageUpdates_Request struct {
	Sessionkey         string    `xmlrpc:"sessionKey"`
	Sids               []int     `xmlrpc:"sids"`
	EarliestOccurrence time.Time `xmlrpc:"earliestOccurrence"`
}

type SchedulePackageUpdates_Response

type SchedulePackageUpdates_Response struct {
	ActionId int
}

type ScheduleSPMigrationDryRun_Request

type ScheduleSPMigrationDryRun_Request struct {
	Sessionkey                                  string    `xmlrpc:"sessionKey"`
	Sid                                         int       `xmlrpc:"sid"`
	TargetIdent                                 string    `xmlrpc:"targetIdent"`
	BaseChannelLabel                            string    `xmlrpc:"baseChannelLabel"`
	OptionalChildChannels                       []string  `xmlrpc:"optionalChildChannels"`
	DryRun                                      bool      `xmlrpc:"dryRun"`
	AllowVendorChange                           bool      `xmlrpc:"allowVendorChange"`
	RemoveProductsWithNoSuccessorAfterMigration bool      `xmlrpc:"removeProductsWithNoSuccessorAfterMigration"`
	EarliestOccurrence                          time.Time `xmlrpc:"earliestOccurrence"`
}

type ScheduleSPMigrationDryRun_Response

type ScheduleSPMigrationDryRun_Response struct {
	JobID int `xmlrpc:"id"`
}

type Schedule_Pkg_Refresh_Request

type Schedule_Pkg_Refresh_Request struct {
	Sessionkey         string    `xmlrpc:"sessionKey"`
	Sid                int       `xmlrpc:"sid"`
	EarliestOccurrence time.Time `xmlrpc:"earliestOccurrence"`
}

type Schedule_Pkg_Refresh_Response

type Schedule_Pkg_Refresh_Response struct {
	JobID int `xmlrpc:"id"`
}

type Schedule_Reboot_Request

type Schedule_Reboot_Request struct {
	Sessionkey         string    `xmlrpc:"sessionKey"`
	Sid                int       `xmlrpc:"sid"`
	EarliestOccurrence time.Time `xmlrpc:"earliestOccurrence"`
}

type Schedule_Reboot_Response

type Schedule_Reboot_Response struct {
	JobID int `xmlrpc:"id"`
}

type Schedule_high_state_Request

type Schedule_high_state_Request struct {
	Sessionkey         string    `xmlrpc:"sessionKey"`
	Sids               []int     `xmlrpc:"sid"`
	EarliestOccurrence time.Time `xmlrpc:"earliestOccurrence"`
	Test               bool      `xmlrpc:"test"`
}

type Struct

type Struct struct {
	Members []Member `xml:"member"`
}

func (Struct) GetMemberValue

func (s Struct) GetMemberValue(name string) interface{}

type Target_Minions

type Target_Minions struct {
	Minion_List             []Minion_Data       `json:"Minion_List"`
	Tracking_file_name      string              `json:"Tracking_file_name"`
	Suma_Group              string              `json:"Suma_Group"`
	Disk_Check_Disqualified []string            `json:"Disk_Check_Disqualified"`
	No_Upgrade_Exceptions   []string            `json:"No_Upgrade_Exceptions"`
	Offline_Minions         []string            `json:"Offline_Minions"`
	No_Targets_Minions      []Minion_Data       `json:"No_Targets_Minions"`
	CSV_Reports             []string            `json:"CSV_Reports"`
	Jobcheck_Timeout        int                 `json:"Jobcheck_Timeout"`
	Reboot_Timeout          int                 `json:"Reboot_Timeout"`
	Minion_Environment_List []map[string]string `json:"Minion_Environment_List"`
}

func (*Target_Minions) Add_No_Target_Minions

func (m *Target_Minions) Add_No_Target_Minions(list []Minion_Data)

func (*Target_Minions) Add_Offline_Minions

func (m *Target_Minions) Add_Offline_Minions(list []string)

func (*Target_Minions) Add_Online_Minions

func (m *Target_Minions) Add_Online_Minions(list []Minion_Data)

func (*Target_Minions) Add_Systems_To_SPMigration_Group

func (t *Target_Minions) Add_Systems_To_SPMigration_Group(sessionkey *auth.SumaSessionKey)

func (*Target_Minions) Analyze_Pending_SPMigration

func (t *Target_Minions) Analyze_Pending_SPMigration(sessionkey *auth.SumaSessionKey,
	groupsdata *Migration_Groups, email_template_dir string, health *bool)

func (*Target_Minions) Assign_Channels

func (t *Target_Minions) Assign_Channels(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups)

func (*Target_Minions) Check_Assigne_Channels_Jobs

func (t *Target_Minions) Check_Assigne_Channels_Jobs(sessionkey *auth.SumaSessionKey, health *bool)

func (*Target_Minions) Check_Package_Updates_Jobs

func (t *Target_Minions) Check_Package_Updates_Jobs(sessionkey *auth.SumaSessionKey, jobid_pkg_update int,
	email_job email.Job_Email_Body, jobinfo Email_job_info, health *bool)

func (*Target_Minions) Check_Pkg_Refresh_Jobs

func (t *Target_Minions) Check_Pkg_Refresh_Jobs(sessionkey *auth.SumaSessionKey, email_job email.Job_Email_Body, jobinfo Email_job_info, health *bool)

func (*Target_Minions) Check_Reboot_Jobs

func (t *Target_Minions) Check_Reboot_Jobs(sessionkey *auth.SumaSessionKey, email_job email.Job_Email_Body, jobinfo Email_job_info, health *bool)

func (*Target_Minions) Check_SP_Migration

func (t *Target_Minions) Check_SP_Migration(sessionkey *auth.SumaSessionKey, dryrun bool, email_job email.Job_Email_Body, jobinfo Email_job_info, health *bool)

func (*Target_Minions) Create_SPMigration_Group

func (t *Target_Minions) Create_SPMigration_Group(sessionkey *auth.SumaSessionKey,
	UserData *Migration_Groups)

func (*Target_Minions) Detect_Online_Minions

func (m *Target_Minions) Detect_Online_Minions(sessionkey *auth.SumaSessionKey, list []Minion_Data, groupsdata *Migration_Groups) (online_minions []Minion_Data, offline_minions []string)

func (*Target_Minions) Find_Assigne_Channels_Jobs

func (t *Target_Minions) Find_Assigne_Channels_Jobs(alljobs *schedules.ListJobs)

func (*Target_Minions) Find_Pkg_Refresh_Jobs

func (t *Target_Minions) Find_Pkg_Refresh_Jobs(alljobs *schedules.ListJobs, email_job *email.Job_Email_Body, jobinfo *Email_job_info)

func (*Target_Minions) Find_Pkg_Refresh_Jobs_No_Targets

func (t *Target_Minions) Find_Pkg_Refresh_Jobs_No_Targets(alljobs *schedules.ListJobs, email_job *email.Job_Email_Body, jobinfo *Email_job_info)

func (*Target_Minions) Find_Reboot_Jobs

func (t *Target_Minions) Find_Reboot_Jobs(alljobs *schedules.ListJobs, email_job *email.Job_Email_Body, jobinfo *Email_job_info)

func (*Target_Minions) Find_Reboot_Jobs_No_Targets

func (t *Target_Minions) Find_Reboot_Jobs_No_Targets(alljobs *schedules.ListJobs, email_job *email.Job_Email_Body, jobinfo *Email_job_info)

func (*Target_Minions) Find_SPMigration_Jobs

func (t *Target_Minions) Find_SPMigration_Jobs(alljobs *schedules.ListJobs, dryrun bool, email_job *email.Job_Email_Body, jobinfo *Email_job_info)

func (*Target_Minions) Get_Minions

func (m *Target_Minions) Get_Minions(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups) error

func (*Target_Minions) ListMigrationTarget

func (t *Target_Minions) ListMigrationTarget(sessionkey *auth.SumaSessionKey, UserData *Migration_Groups)

func (*Target_Minions) Reschedule_Pkg_Refresh

func (t *Target_Minions) Reschedule_Pkg_Refresh(sessionkey *auth.SumaSessionKey)

func (*Target_Minions) SPMigration_Group

func (t *Target_Minions) SPMigration_Group(sessionkey *auth.SumaSessionKey, UserData *Migration_Groups)

func (*Target_Minions) Salt_CSV_Report

func (m *Target_Minions) Salt_CSV_Report(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups)

func (*Target_Minions) Salt_Disk_Space_Check

func (m *Target_Minions) Salt_Disk_Space_Check(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups)

func (*Target_Minions) Salt_No_Upgrade_Exception_Check

func (m *Target_Minions) Salt_No_Upgrade_Exception_Check(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups)

func (*Target_Minions) Salt_Refresh_Grains

func (m *Target_Minions) Salt_Refresh_Grains(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups)

func (*Target_Minions) Salt_Run_state_apply

func (m *Target_Minions) Salt_Run_state_apply(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups, stage string)

func (*Target_Minions) Salt_Set_Patch_Level

func (m *Target_Minions) Salt_Set_Patch_Level(sessionkey *auth.SumaSessionKey, groupsdata *Migration_Groups)

func (*Target_Minions) Schedule_Migration

func (t *Target_Minions) Schedule_Migration(sessionkey *auth.SumaSessionKey,
	UserData *Migration_Groups, dryrun bool)

func (*Target_Minions) Schedule_Package_Updates

func (t *Target_Minions) Schedule_Package_Updates(sessionkey *auth.SumaSessionKey) int

func (*Target_Minions) Schedule_Pkg_refresh

func (t *Target_Minions) Schedule_Pkg_refresh(sessionkey *auth.SumaSessionKey)

func (*Target_Minions) Schedule_Reboot

func (t *Target_Minions) Schedule_Reboot(sessionkey *auth.SumaSessionKey)

func (*Target_Minions) Schedule_high_state

func (t *Target_Minions) Schedule_high_state(sessionkey *auth.SumaSessionKey)

func (*Target_Minions) Show_Minions

func (s *Target_Minions) Show_Minions()

func (*Target_Minions) Update_Target_Minion_Status

func (t *Target_Minions) Update_Target_Minion_Status(analyase_minions *Target_Minions)

func (*Target_Minions) Write_Tracking_file

func (t *Target_Minions) Write_Tracking_file()

type Target_Product

type Target_Product struct {
	Name                  string            `json:"name"`
	Ident                 string            `json:"ident"`
	Base_Channel          string            `json:"base_channel_label"`
	Clm_Project_Label     string            `json:"clm_project_label"`
	OptionalChildChannels []OptionalChannel `json:"optionalChildChannels"`
}

type Update_Pkg_Job

type Update_Pkg_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Value

type Value struct {
	Array Array `xml:"array"`
}

type Value_ActiveSystems_in_Group

type Value_ActiveSystems_in_Group struct {
	Array Array_ActiveSystems_in_Group `xml:"array"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL