hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43cd0db94095acf332866fe969383985d7ef2a71 | 2,087 | go | Go | runsc/boot/compat_amd64.go | zhangningdlut/gvisor | a2956163267e253f614dd2d6d8151614b9b0dc77 | [
"Apache-2.0"
] | 2 | 2020-07-24T04:06:44.000Z | 2021-06-28T00:49:20.000Z | runsc/boot/compat_amd64.go | zhangningdlut/gvisor | a2956163267e253f614dd2d6d8151614b9b0dc77 | [
"Apache-2.0"
] | null | null | null | runsc/boot/compat_amd64.go | zhangningdlut/gvisor | a2956163267e253f614dd2d6d8151614b9b0dc77 | [
"Apache-2.0"
] | 2 | 2018-09-16T21:15:29.000Z | 2020-05-12T15:12:50.000Z | // Copyright 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package boot
import (
"fmt"
rpb "gvisor.dev/gvisor/pkg/sentry/arch/registers_go_proto"
)
// reportLimit is the max number of events that should be reported per tracker.
const reportLimit = 100
// argsTracker reports only once for each different combination of arguments.
// It's used for generic syscalls like ioctl to report once per 'cmd'.
type argsTracker struct {
// argsIdx is the syscall arguments to use as unique ID.
argsIdx []int
reported map[string]struct{}
count int
}
func newArgsTracker(argIdx ...int) *argsTracker {
return &argsTracker{argsIdx: argIdx, reported: make(map[string]struct{})}
}
// cmd returns the command based on the syscall argument index.
func (a *argsTracker) key(regs *rpb.AMD64Registers) string {
var rv string
for _, idx := range a.argsIdx {
rv += fmt.Sprintf("%d|", argVal(idx, regs))
}
return rv
}
func argVal(argIdx int, regs *rpb.AMD64Registers) uint32 {
switch argIdx {
case 0:
return uint32(regs.Rdi)
case 1:
return uint32(regs.Rsi)
case 2:
return uint32(regs.Rdx)
case 3:
return uint32(regs.R10)
case 4:
return uint32(regs.R8)
case 5:
return uint32(regs.R9)
}
panic(fmt.Sprintf("invalid syscall argument index %d", argIdx))
}
func (a *argsTracker) shouldReport(regs *rpb.AMD64Registers) bool {
if a.count >= reportLimit {
return false
}
_, ok := a.reported[a.key(regs)]
return !ok
}
func (a *argsTracker) onReported(regs *rpb.AMD64Registers) {
a.count++
a.reported[a.key(regs)] = struct{}{}
}
| 26.75641 | 79 | 0.723047 |
a1f1cfc62a913cbc528f75cea1d2ee6e24d0b84a | 92,645 | c | C | sdk-6.5.20/src/shared/swstate/access/sw_state_dpp_soc_arad_pp_dbal_info_access.c | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/src/shared/swstate/access/sw_state_dpp_soc_arad_pp_dbal_info_access.c | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/src/shared/swstate/access/sw_state_dpp_soc_arad_pp_dbal_info_access.c | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | /*
*
* This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
*
* Copyright 2007-2020 Broadcom Inc. All rights reserved.
*
* DO NOT EDIT THIS FILE!
* This file is auto-generated.
* Edits to this file will be lost when it is regenerated.
*/
#include <sal/core/libc.h>
#include <shared/swstate/sw_state.h>
#include <shared/error.h>
#include <shared/swstate/sw_state_defs.h>
#include <shared/bsl.h>
#include <shared/swstate/access/sw_state_access.h>
#include <shared/swstate/access/sw_state_dpp_soc_arad_pp_dbal_info_access.h>
#ifdef _ERR_MSG_MODULE_NAME
#error "_ERR_MSG_MODULE_NAME redefined"
#endif
#define _ERR_MSG_MODULE_NAME BSL_LS_SHARED_SWSTATE
extern shr_sw_state_t *sw_state[BCM_MAX_NUM_UNITS];
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_set(int unit, CONST SOC_DPP_DBAL_INFO *dbal_info){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.verify( unit));
SHR_SW_STATE_MEMSET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info[0],
dbal_info,
SOC_DPP_DBAL_INFO,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_get(int unit, SOC_DPP_DBAL_INFO *dbal_info){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.verify( unit));
*dbal_info = sw_state[unit]->dpp.soc.arad.pp->dbal_info[0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_alloc(int unit){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_ALLOC(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info,
sizeof(SOC_DPP_DBAL_INFO),
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_alloc");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_is_allocated(int unit, uint8 *is_allocated){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_IS_ALLOC(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info,
is_allocated,
SW_STATE_NONE,
"sw_state_dpp_soc_arad_pp_dbal_info_alloc");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_free(int unit){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_FREE(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info,
SW_STATE_NONE,
"sw_state_dpp_soc_arad_pp_dbal_info_alloc");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_verify(int unit){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_NULL_ACCESS_CHECK(sw_state[unit]->dpp.soc.arad.pp->dbal_info);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_set(int unit, int dbal_tables_idx_0, CONST SOC_DPP_DBAL_TABLE_INFO *dbal_tables){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_MEMSET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0],
dbal_tables,
SOC_DPP_DBAL_TABLE_INFO,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_get(int unit, int dbal_tables_idx_0, SOC_DPP_DBAL_TABLE_INFO *dbal_tables){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0));
*dbal_tables = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( dbal_tables_idx_0, SOC_DPP_DBAL_SW_NOF_TABLES, "dbal_tables");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_is_table_initiated_set(int unit, int dbal_tables_idx_0, uint8 is_table_initiated){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.is_table_initiated.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].is_table_initiated,
is_table_initiated,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_is_table_initiated_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_is_table_initiated_get(int unit, int dbal_tables_idx_0, uint8 *is_table_initiated){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.is_table_initiated.verify( unit, dbal_tables_idx_0));
*is_table_initiated = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].is_table_initiated;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_is_table_initiated_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_physical_db_type_set(int unit, int dbal_tables_idx_0, SOC_DPP_DBAL_PHYSICAL_DB_TYPES physical_db_type){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.physical_db_type.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].physical_db_type,
physical_db_type,
SOC_DPP_DBAL_PHYSICAL_DB_TYPES,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_physical_db_type_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_physical_db_type_get(int unit, int dbal_tables_idx_0, SOC_DPP_DBAL_PHYSICAL_DB_TYPES *physical_db_type){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.physical_db_type.verify( unit, dbal_tables_idx_0));
*physical_db_type = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].physical_db_type;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_physical_db_type_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_set(int unit, int dbal_tables_idx_0, uint32 db_prefix){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].db_prefix,
db_prefix,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_get(int unit, int dbal_tables_idx_0, uint32 *db_prefix){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix.verify( unit, dbal_tables_idx_0));
*db_prefix = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].db_prefix;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_len_set(int unit, int dbal_tables_idx_0, uint32 db_prefix_len){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix_len.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].db_prefix_len,
db_prefix_len,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_len_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_len_get(int unit, int dbal_tables_idx_0, uint32 *db_prefix_len){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix_len.verify( unit, dbal_tables_idx_0));
*db_prefix_len = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].db_prefix_len;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_len_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_set(int unit, int dbal_tables_idx_0, int qual_info_idx_0, CONST SOC_DPP_DBAL_QUAL_INFO *qual_info){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
SHR_SW_STATE_MEMSET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0],
qual_info,
SOC_DPP_DBAL_QUAL_INFO,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_get(int unit, int dbal_tables_idx_0, int qual_info_idx_0, SOC_DPP_DBAL_QUAL_INFO *qual_info){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
*qual_info = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_verify(int unit, int dbal_tables_idx_0, int qual_info_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( qual_info_idx_0, SOC_PPC_FP_NOF_QUALS_PER_DB_MAX, "qual_info");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_type_set(int unit, int dbal_tables_idx_0, int qual_info_idx_0, SOC_PPC_FP_QUAL_TYPE qual_type){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_type.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_type,
qual_type,
SOC_PPC_FP_QUAL_TYPE,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_type_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_type_get(int unit, int dbal_tables_idx_0, int qual_info_idx_0, SOC_PPC_FP_QUAL_TYPE *qual_type){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_type.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
*qual_type = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_type;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_type_verify(int unit, int dbal_tables_idx_0, int qual_info_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_offset_set(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 qual_offset){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_offset.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_offset,
qual_offset,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_offset_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_offset_get(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 *qual_offset){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_offset.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
*qual_offset = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_offset;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_offset_verify(int unit, int dbal_tables_idx_0, int qual_info_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_ignore_qual_offset_for_entry_mngmnt_set(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 ignore_qual_offset_for_entry_mngmnt){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.ignore_qual_offset_for_entry_mngmnt.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].ignore_qual_offset_for_entry_mngmnt,
ignore_qual_offset_for_entry_mngmnt,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_ignore_qual_offset_for_entry_mngmnt_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_ignore_qual_offset_for_entry_mngmnt_get(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 *ignore_qual_offset_for_entry_mngmnt){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.ignore_qual_offset_for_entry_mngmnt.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
*ignore_qual_offset_for_entry_mngmnt = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].ignore_qual_offset_for_entry_mngmnt;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_ignore_qual_offset_for_entry_mngmnt_verify(int unit, int dbal_tables_idx_0, int qual_info_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_nof_bits_set(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 qual_nof_bits){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_nof_bits.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_nof_bits,
qual_nof_bits,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_nof_bits_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_nof_bits_get(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 *qual_nof_bits){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_nof_bits.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
*qual_nof_bits = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_nof_bits;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_nof_bits_verify(int unit, int dbal_tables_idx_0, int qual_info_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_full_size_set(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 qual_full_size){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_full_size.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_full_size,
qual_full_size,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_full_size_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_full_size_get(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 *qual_full_size){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_full_size.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
*qual_full_size = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_full_size;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_full_size_verify(int unit, int dbal_tables_idx_0, int qual_info_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_is_in_hdr_set(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 qual_is_in_hdr){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_is_in_hdr.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_is_in_hdr,
qual_is_in_hdr,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_is_in_hdr_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_is_in_hdr_get(int unit, int dbal_tables_idx_0, int qual_info_idx_0, uint8 *qual_is_in_hdr){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_is_in_hdr.verify( unit, dbal_tables_idx_0, qual_info_idx_0));
*qual_is_in_hdr = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].qual_info[qual_info_idx_0].qual_is_in_hdr;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_is_in_hdr_verify(int unit, int dbal_tables_idx_0, int qual_info_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify( unit, dbal_tables_idx_0, qual_info_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_qualifiers_set(int unit, int dbal_tables_idx_0, int nof_qualifiers){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_qualifiers.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_qualifiers,
nof_qualifiers,
int,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_qualifiers_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_qualifiers_get(int unit, int dbal_tables_idx_0, int *nof_qualifiers){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_qualifiers.verify( unit, dbal_tables_idx_0));
*nof_qualifiers = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_qualifiers;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_qualifiers_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_additional_table_info_set(int unit, int dbal_tables_idx_0, uint32 additional_table_info){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.additional_table_info.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].additional_table_info,
additional_table_info,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_additional_table_info_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_additional_table_info_get(int unit, int dbal_tables_idx_0, uint32 *additional_table_info){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.additional_table_info.verify( unit, dbal_tables_idx_0));
*additional_table_info = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].additional_table_info;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_additional_table_info_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_name_set(int unit, int dbal_tables_idx_0, int table_name_idx_0, char table_name){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_name.verify( unit, dbal_tables_idx_0, table_name_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_name[table_name_idx_0],
table_name,
char,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_name_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_name_get(int unit, int dbal_tables_idx_0, int table_name_idx_0, char *table_name){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_name.verify( unit, dbal_tables_idx_0, table_name_idx_0));
*table_name = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_name[table_name_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_name_verify(int unit, int dbal_tables_idx_0, int table_name_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( table_name_idx_0, DBAL_MAX_NAME_LENGTH, "table_name");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, CONST DBAL_PROGRAM_INFO *table_programs){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
SHR_SW_STATE_MEMSET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0],
table_programs,
DBAL_PROGRAM_INFO,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, DBAL_PROGRAM_INFO *table_programs){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
*table_programs = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( table_programs_idx_0, DBAL_MAX_PROGRAMS_PER_TABLE, "table_programs");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_stage_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, SOC_PPC_FP_DATABASE_STAGE stage){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.stage.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].stage,
stage,
SOC_PPC_FP_DATABASE_STAGE,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_stage_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_stage_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, SOC_PPC_FP_DATABASE_STAGE *stage){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.stage.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
*stage = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].stage;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_stage_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_program_id_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint32 program_id){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.program_id.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].program_id,
program_id,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_program_id_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_program_id_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint32 *program_id){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.program_id.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
*program_id = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].program_id;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_program_id_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_lookup_number_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint8 lookup_number){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.lookup_number.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].lookup_number,
lookup_number,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_lookup_number_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_lookup_number_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint8 *lookup_number){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.lookup_number.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
*lookup_number = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].lookup_number;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_lookup_number_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_key_id_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint32 key_id){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.key_id.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].key_id,
key_id,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_key_id_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_key_id_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint32 *key_id){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.key_id.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
*key_id = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].key_id;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_key_id_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_nof_bits_used_in_key_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, int nof_bits_used_in_key){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.nof_bits_used_in_key.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].nof_bits_used_in_key,
nof_bits_used_in_key,
int,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_nof_bits_used_in_key_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_nof_bits_used_in_key_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, int *nof_bits_used_in_key){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.nof_bits_used_in_key.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
*nof_bits_used_in_key = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].nof_bits_used_in_key;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_nof_bits_used_in_key_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_ce_assigned_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, int ce_assigned_idx_0, uint8 ce_assigned){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.ce_assigned.verify( unit, dbal_tables_idx_0, table_programs_idx_0, ce_assigned_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].ce_assigned[ce_assigned_idx_0],
ce_assigned,
uint8,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_ce_assigned_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_ce_assigned_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, int ce_assigned_idx_0, uint8 *ce_assigned){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.ce_assigned.verify( unit, dbal_tables_idx_0, table_programs_idx_0, ce_assigned_idx_0));
*ce_assigned = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].ce_assigned[ce_assigned_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_ce_assigned_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0, int ce_assigned_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( ce_assigned_idx_0, SOC_PPC_FP_NOF_QUALS_PER_DB_MAX, "ce_assigned");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_public_lpm_lookup_size_set(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint32 public_lpm_lookup_size){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.public_lpm_lookup_size.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].public_lpm_lookup_size,
public_lpm_lookup_size,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_public_lpm_lookup_size_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_public_lpm_lookup_size_get(int unit, int dbal_tables_idx_0, int table_programs_idx_0, uint32 *public_lpm_lookup_size){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.public_lpm_lookup_size.verify( unit, dbal_tables_idx_0, table_programs_idx_0));
*public_lpm_lookup_size = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_programs[table_programs_idx_0].public_lpm_lookup_size;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_public_lpm_lookup_size_verify(int unit, int dbal_tables_idx_0, int table_programs_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify( unit, dbal_tables_idx_0, table_programs_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_table_programs_set(int unit, int dbal_tables_idx_0, int nof_table_programs){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_table_programs.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_table_programs,
nof_table_programs,
int,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_table_programs_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_table_programs_get(int unit, int dbal_tables_idx_0, int *nof_table_programs){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_table_programs.verify( unit, dbal_tables_idx_0));
*nof_table_programs = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_table_programs;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_table_programs_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_entries_added_to_table_set(int unit, int dbal_tables_idx_0, uint32 nof_entries_added_to_table){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_entries_added_to_table.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_entries_added_to_table,
nof_entries_added_to_table,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_entries_added_to_table_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_entries_added_to_table_get(int unit, int dbal_tables_idx_0, uint32 *nof_entries_added_to_table){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_entries_added_to_table.verify( unit, dbal_tables_idx_0));
*nof_entries_added_to_table = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_entries_added_to_table;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_entries_added_to_table_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_action_set(int unit, int dbal_tables_idx_0, int action_idx_0, SOC_PPC_FP_ACTION_TYPE action){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.action.verify( unit, dbal_tables_idx_0, action_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].action[action_idx_0],
action,
SOC_PPC_FP_ACTION_TYPE,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_action_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_action_get(int unit, int dbal_tables_idx_0, int action_idx_0, SOC_PPC_FP_ACTION_TYPE *action){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.action.verify( unit, dbal_tables_idx_0, action_idx_0));
*action = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].action[action_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_action_verify(int unit, int dbal_tables_idx_0, int action_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( action_idx_0, SOC_PPC_FP_NOF_ACTIONS_PER_DB_MAX, "action");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_actions_set(int unit, int dbal_tables_idx_0, int nof_actions){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_actions.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_actions,
nof_actions,
int,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_actions_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_actions_get(int unit, int dbal_tables_idx_0, int *nof_actions){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_actions.verify( unit, dbal_tables_idx_0));
*nof_actions = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].nof_actions;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_actions_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_iterator_set(int unit, int dbal_tables_idx_0, DBAL_ITERATOR table_iterator){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_iterator.verify( unit, dbal_tables_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_iterator,
table_iterator,
DBAL_ITERATOR,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_iterator_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_iterator_get(int unit, int dbal_tables_idx_0, DBAL_ITERATOR *table_iterator){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_iterator.verify( unit, dbal_tables_idx_0));
*table_iterator = sw_state[unit]->dpp.soc.arad.pp->dbal_info->dbal_tables[dbal_tables_idx_0].table_iterator;
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_iterator_verify(int unit, int dbal_tables_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify( unit, dbal_tables_idx_0);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_sem_a_prefix_mapping_set(int unit, int sem_a_prefix_mapping_idx_0, SOC_DPP_DBAL_SW_TABLE_IDS sem_a_prefix_mapping){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_a_prefix_mapping.verify( unit, sem_a_prefix_mapping_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->sem_a_prefix_mapping[sem_a_prefix_mapping_idx_0],
sem_a_prefix_mapping,
SOC_DPP_DBAL_SW_TABLE_IDS,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_sem_a_prefix_mapping_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_sem_a_prefix_mapping_get(int unit, int sem_a_prefix_mapping_idx_0, SOC_DPP_DBAL_SW_TABLE_IDS *sem_a_prefix_mapping){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_a_prefix_mapping.verify( unit, sem_a_prefix_mapping_idx_0));
*sem_a_prefix_mapping = sw_state[unit]->dpp.soc.arad.pp->dbal_info->sem_a_prefix_mapping[sem_a_prefix_mapping_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_sem_a_prefix_mapping_verify(int unit, int sem_a_prefix_mapping_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( sem_a_prefix_mapping_idx_0, (1<<ARAD_PP_ISEM_ACCESS_MAX_PREFIX_SIZE_JER), "sem_a_prefix_mapping");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_sem_b_prefix_mapping_set(int unit, int sem_b_prefix_mapping_idx_0, SOC_DPP_DBAL_SW_TABLE_IDS sem_b_prefix_mapping){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_b_prefix_mapping.verify( unit, sem_b_prefix_mapping_idx_0));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->dbal_info->sem_b_prefix_mapping[sem_b_prefix_mapping_idx_0],
sem_b_prefix_mapping,
SOC_DPP_DBAL_SW_TABLE_IDS,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_dbal_info_sem_b_prefix_mapping_set");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_sem_b_prefix_mapping_get(int unit, int sem_b_prefix_mapping_idx_0, SOC_DPP_DBAL_SW_TABLE_IDS *sem_b_prefix_mapping){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_b_prefix_mapping.verify( unit, sem_b_prefix_mapping_idx_0));
*sem_b_prefix_mapping = sw_state[unit]->dpp.soc.arad.pp->dbal_info->sem_b_prefix_mapping[sem_b_prefix_mapping_idx_0];
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_dbal_info_sem_b_prefix_mapping_verify(int unit, int sem_b_prefix_mapping_idx_0){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.dbal_info.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_OUT_OF_BOUND_CHECK( sem_b_prefix_mapping_idx_0, (1<<ARAD_PP_ISEM_ACCESS_MAX_PREFIX_SIZE_JER), "sem_b_prefix_mapping");
SW_STATE_FUNC_RETURN;
}
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
int
sw_state_dpp_soc_arad_pp_dbal_info_access_cb_init(int unit){
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.set = sw_state_dpp_soc_arad_pp_dbal_info_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.get = sw_state_dpp_soc_arad_pp_dbal_info_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.alloc = sw_state_dpp_soc_arad_pp_dbal_info_alloc;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.is_allocated = sw_state_dpp_soc_arad_pp_dbal_info_is_allocated;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.free = sw_state_dpp_soc_arad_pp_dbal_info_free;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.verify = sw_state_dpp_soc_arad_pp_dbal_info_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.is_table_initiated.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_is_table_initiated_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.is_table_initiated.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_is_table_initiated_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.is_table_initiated.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_is_table_initiated_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.physical_db_type.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_physical_db_type_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.physical_db_type.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_physical_db_type_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.physical_db_type.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_physical_db_type_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix_len.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_len_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix_len.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_len_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.db_prefix_len.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_db_prefix_len_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_type.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_type_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_type.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_type_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_type.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_type_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_offset.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_offset_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_offset.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_offset_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_offset.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_offset_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.ignore_qual_offset_for_entry_mngmnt.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_ignore_qual_offset_for_entry_mngmnt_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.ignore_qual_offset_for_entry_mngmnt.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_ignore_qual_offset_for_entry_mngmnt_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.ignore_qual_offset_for_entry_mngmnt.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_ignore_qual_offset_for_entry_mngmnt_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_nof_bits.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_nof_bits_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_nof_bits.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_nof_bits_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_nof_bits.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_nof_bits_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_full_size.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_full_size_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_full_size.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_full_size_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_full_size.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_full_size_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_is_in_hdr.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_is_in_hdr_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_is_in_hdr.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_is_in_hdr_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.qual_info.qual_is_in_hdr.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_qual_info_qual_is_in_hdr_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_qualifiers.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_qualifiers_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_qualifiers.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_qualifiers_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_qualifiers.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_qualifiers_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.additional_table_info.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_additional_table_info_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.additional_table_info.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_additional_table_info_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.additional_table_info.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_additional_table_info_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_name.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_name_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_name.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_name_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_name.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_name_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.stage.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_stage_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.stage.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_stage_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.stage.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_stage_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.program_id.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_program_id_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.program_id.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_program_id_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.program_id.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_program_id_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.lookup_number.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_lookup_number_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.lookup_number.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_lookup_number_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.lookup_number.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_lookup_number_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.key_id.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_key_id_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.key_id.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_key_id_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.key_id.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_key_id_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.nof_bits_used_in_key.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_nof_bits_used_in_key_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.nof_bits_used_in_key.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_nof_bits_used_in_key_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.nof_bits_used_in_key.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_nof_bits_used_in_key_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.ce_assigned.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_ce_assigned_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.ce_assigned.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_ce_assigned_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.ce_assigned.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_ce_assigned_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.public_lpm_lookup_size.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_public_lpm_lookup_size_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.public_lpm_lookup_size.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_public_lpm_lookup_size_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_programs.public_lpm_lookup_size.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_programs_public_lpm_lookup_size_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_table_programs.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_table_programs_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_table_programs.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_table_programs_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_table_programs.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_table_programs_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_entries_added_to_table.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_entries_added_to_table_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_entries_added_to_table.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_entries_added_to_table_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_entries_added_to_table.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_entries_added_to_table_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.action.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_action_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.action.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_action_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.action.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_action_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_actions.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_actions_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_actions.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_actions_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.nof_actions.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_nof_actions_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_iterator.set = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_iterator_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_iterator.get = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_iterator_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.dbal_tables.table_iterator.verify = sw_state_dpp_soc_arad_pp_dbal_info_dbal_tables_table_iterator_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_a_prefix_mapping.set = sw_state_dpp_soc_arad_pp_dbal_info_sem_a_prefix_mapping_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_a_prefix_mapping.get = sw_state_dpp_soc_arad_pp_dbal_info_sem_a_prefix_mapping_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_a_prefix_mapping.verify = sw_state_dpp_soc_arad_pp_dbal_info_sem_a_prefix_mapping_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_b_prefix_mapping.set = sw_state_dpp_soc_arad_pp_dbal_info_sem_b_prefix_mapping_set;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_b_prefix_mapping.get = sw_state_dpp_soc_arad_pp_dbal_info_sem_b_prefix_mapping_get;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
#ifdef BCM_PETRA_SUPPORT
#if defined(BCM_PETRA_SUPPORT)
sw_state_access[unit].dpp.soc.arad.pp.dbal_info.sem_b_prefix_mapping.verify = sw_state_dpp_soc_arad_pp_dbal_info_sem_b_prefix_mapping_verify;
#endif /* defined(BCM_PETRA_SUPPORT)*/
#endif /* BCM_PETRA_SUPPORT*/
return _SHR_E_NONE;
}
#undef _ERR_MSG_MODULE_NAME
| 47.051803 | 219 | 0.80748 |
16b49ce32730e0ab340682a1bfd467e8c4913d39 | 158 | h | C | ref/frame.h | uucidl/exp.rendering-api | 46e0789b06bd20629a63678d7988317d0a2f0dd7 | [
"MIT"
] | null | null | null | ref/frame.h | uucidl/exp.rendering-api | 46e0789b06bd20629a63678d7988317d0a2f0dd7 | [
"MIT"
] | null | null | null | ref/frame.h | uucidl/exp.rendering-api | 46e0789b06bd20629a63678d7988317d0a2f0dd7 | [
"MIT"
] | null | null | null | #pragma once
class DisplayFrameImpl;
void display_frame_define(DisplayFrameImpl* frame, void* context);
void display_frame_commit(DisplayFrameImpl* frame);
| 22.571429 | 66 | 0.835443 |
cb5a33c3d57b0ba687e50a07f12daae827d36de1 | 2,006 | go | Go | feeder/neo4jDao.go | mateuszdyminski/flights-analyzer | 53b6ba5890c944952a6d68b4f144e5a4288bbf49 | [
"MIT"
] | 1 | 2015-11-11T21:40:45.000Z | 2015-11-11T21:40:45.000Z | feeder/neo4jDao.go | mateuszdyminski/flights-analyzer | 53b6ba5890c944952a6d68b4f144e5a4288bbf49 | [
"MIT"
] | null | null | null | feeder/neo4jDao.go | mateuszdyminski/flights-analyzer | 53b6ba5890c944952a6d68b4f144e5a4288bbf49 | [
"MIT"
] | null | null | null | package feeder
import (
"fmt"
"log"
"github.com/jmcvetta/neoism"
)
// NeoDao struct for accessing neo4j db.
type neoDao struct {
db *neoism.Database
}
// NewGraphDao creates new access struct for manipulating neo4j db.
func NewGraphDao(address string) GraphDao {
db, err := neoism.Connect(address)
if err != nil {
log.Fatalf("Can't open neo4j db: %v", err)
}
return &neoDao{db: db}
}
// Insert inserts airport node.
func (d *neoDao) Insert(a *Airport) error {
n, err := d.db.CreateNode(neoism.Props{"name": a.Name, "iata": a.Iata, "lat": a.Lat, "long": a.Long, "country": a.Country.Code})
if err != nil {
return err
}
a.ID = n.Id()
return nil
}
// InsertRoutes inserts all destinations as edges.
func (d *neoDao) InsertRoutes(id int, routes []Route) error {
n, err := d.db.Node(id)
if err != nil {
return fmt.Errorf("can't find node(%d), err: %v", err)
}
for _, f := range routes {
if _, err := n.Relate("route", f.To.ID, neoism.Props{}); err != nil {
return fmt.Errorf("can't create relation between(%d %d), err: %v", n.Id(), f.To.ID, err)
}
}
return nil
}
// InsertRoutes inserts all flights as edges.
func (d *neoDao) InsertFlights(id int, flights Flights) error {
n, err := d.db.Node(id)
if err != nil {
return fmt.Errorf("can't find node(%d), err: %v", err)
}
for _, f := range flights.Flights {
if _, err := n.Relate("flight", f.Outbound.To.ID,
neoism.Props{
"originalPrice": f.Outbound.Price.Value,
"price": f.Outbound.Price.ValueExchanged,
"currency": f.Outbound.Price.Currency,
"dateFrom": f.Outbound.DateFrom,
"dateTo": f.Outbound.DateTo,
}); err != nil {
return fmt.Errorf("can't create relation between(%d %d), err: %v", n.Id(), f.Outbound.To.ID, err)
}
}
return nil
}
// ClearDB deletes all flights and edges.
func (d *neoDao) ClearDB() error {
cq1 := neoism.CypherQuery{
Statement: `
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r
`,
}
return d.db.Cypher(&cq1)
}
| 23.057471 | 129 | 0.632104 |
d2e6e6c2288ff8dcf23c1ec312cf0aa67b4b48bc | 125 | php | PHP | web7/drush/fordschool_d7.aliases.drushrc.php | shaal/fordschool | 8d52b12a19b00bc8c3ccc956a01f241251c6c0eb | [
"MIT"
] | null | null | null | web7/drush/fordschool_d7.aliases.drushrc.php | shaal/fordschool | 8d52b12a19b00bc8c3ccc956a01f241251c6c0eb | [
"MIT"
] | null | null | null | web7/drush/fordschool_d7.aliases.drushrc.php | shaal/fordschool | 8d52b12a19b00bc8c3ccc956a01f241251c6c0eb | [
"MIT"
] | null | null | null | <?php
$aliases['local'] = array(
'root' => '/var/www/fordschool.local/web7/docroot',
'uri' => 'd7.fordschool.local',
);
| 17.857143 | 53 | 0.608 |
6257d965b06cccaaaf45b2e072cb1fe27842a4e4 | 5,698 | rs | Rust | src/source/nonblocking.rs | postmates/cernan | 7f3f72ab0c785b260d9df5367f9658287d6891d0 | [
"MIT"
] | 331 | 2017-01-13T18:24:11.000Z | 2021-11-14T20:07:57.000Z | src/source/nonblocking.rs | postmates/cernan | 7f3f72ab0c785b260d9df5367f9658287d6891d0 | [
"MIT"
] | 221 | 2017-01-13T19:46:54.000Z | 2019-03-19T22:32:50.000Z | src/source/nonblocking.rs | postmates/cernan | 7f3f72ab0c785b260d9df5367f9658287d6891d0 | [
"MIT"
] | 15 | 2017-01-13T20:46:26.000Z | 2018-09-10T19:10:55.000Z | //! Handy interfaces for nonblocking streams.
use byteorder::{BigEndian, ReadBytesExt};
use mio;
use std::io::{Read, Write};
use std::{io, mem};
/// Like `std::net::TcpStream::write_all`, except it handles `WouldBlock` too.
pub fn write_all(
mut stream: &mio::net::TcpStream,
bytes: &[u8],
) -> Result<(), io::Error> {
let mut written = 0;
while written < bytes.len() {
match stream.write(&bytes[written..]) {
Ok(bytes_written) => {
written += bytes_written;
}
Err(e) => match e.kind() {
io::ErrorKind::WouldBlock | io::ErrorKind::Interrupted => {
continue;
}
_ => {
error!("Failed to write bytes onto stream! {:?}", e);
return Err(e);
}
},
}
}
Ok(())
}
/// Handler error types returned by `handle_avro_payload`.
#[derive(Debug)]
pub enum PayloadErr {
/// End of stream has been reached.
EOF,
/// Not enough data present to construct the payload.
/// Try again later.
WouldBlock,
/// An IO error occured.
IO(io::Error),
/// Payload parsing failure.
Protocol(String),
/// The length prefix is too large to be allocated
LengthTooLarge,
}
impl From<io::Error> for PayloadErr {
fn from(e: io::Error) -> PayloadErr {
if e.kind() == io::ErrorKind::WouldBlock {
PayloadErr::WouldBlock
} else if e.kind() == io::ErrorKind::UnexpectedEof {
PayloadErr::EOF
} else {
PayloadErr::IO(e)
}
}
}
impl From<String> for PayloadErr {
fn from(s: String) -> PayloadErr {
PayloadErr::Protocol(s)
}
}
/// Buffered length-prefixed payload.
///
/// For use on blocking or non-blocking streams.
pub struct BufferedPayload {
/// Size of the expected payload in bytes. When None, this value is read
/// off the underlying stream as a big-endian u32.
payload_size: Option<usize>,
/// The maximum allowable payload size. If a payload_size comes in over the
/// wire that is greater than this limit we close the connection.
max_payload_size: usize,
/// Position in the payload byte vector receiving.
payload_pos: usize,
///Bytes comprising the payload.
payload: Vec<u8>,
/// Inner buffer where bytes from the underlying stream are staged.
buffer: io::BufReader<mio::net::TcpStream>,
}
impl BufferedPayload {
/// Constructs a new BufferedPayload.
pub fn new(stream: mio::net::TcpStream, max_payload_size: usize) -> Self {
BufferedPayload {
payload_size: None,
max_payload_size: max_payload_size,
payload_pos: 0,
payload: Vec::new(),
buffer: io::BufReader::new(stream),
}
}
/// Reads existing buffer from the underlying data
/// stream. If enough data is present, a single payload
/// is constructed and returned.
///
/// On non-blocking streams, it is up to the user to call
/// this method repeatedly until PayloadErr::WouldBlock
/// is returned.
pub fn read(&mut self) -> Result<Vec<u8>, PayloadErr> {
// Are we actively reading a payload already?
if self.payload_size.is_none() {
self.read_length()?;
}
if self.payload_size.unwrap() > self.max_payload_size {
return Err(PayloadErr::LengthTooLarge);
}
self.read_payload()?;
// By this point we assert that we have read exactly
// 1 payload off the buffer. We may have have read partial
// or entire other payloads off the wire. Additional bytes
// will persist in buffer for later parsing.
Ok(mem::replace(&mut self.payload, Vec::new()))
}
/// Reads the payload's length from the wire, caching the result.
///
/// If a cached value already exists, this function noops.
fn read_length(&mut self) -> Result<(), PayloadErr> {
if self.payload_size.is_none() {
self.payload_size = Some(self.buffer.read_u32::<BigEndian>()? as usize);
};
Ok(())
}
/// Attempts to read at least one payload worth of data. If there
/// isn't enough data between the inner buffer and the underlying stream,
/// then PayloadErr::WouldBlock is returned.
fn read_payload(&mut self) -> Result<(), PayloadErr> {
// At this point we can assume that we have successfully
// read the length off the wire.
let payload_size = self.payload_size.unwrap();
if self.payload.len() != payload_size {
trace!("Resizing internal buffer to {:?}", payload_size);
self.payload.resize(payload_size, 0);
}
loop {
match self
.buffer
.read(&mut self.payload[self.payload_pos..payload_size])
{
Ok(0) => return Err(PayloadErr::EOF),
Ok(bytes_read) if (self.payload_pos + bytes_read) == payload_size => {
// We successfully pulled a payload off the wire.
// Reset bytes remaining for the next payload.
self.payload_size = None;
self.payload_pos = 0;
return Ok(());
}
Ok(bytes_read) => {
// We read some data, but not yet enough.
// Store the difference and try again later.
self.payload_pos += bytes_read;
continue;
}
Err(e) => return Err(e.into()),
}
}
}
}
| 31.832402 | 86 | 0.568621 |
2a712b9688efed8a2ddb6a5db42ffa226cb95eb5 | 7,748 | java | Java | src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/launch/tabs/LaunchConfigurationExecutorTab.java | alex729/RED | 128bf203cf035892c02805aabd0c915f96006bb0 | [
"Apache-2.0"
] | null | null | null | src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/launch/tabs/LaunchConfigurationExecutorTab.java | alex729/RED | 128bf203cf035892c02805aabd0c915f96006bb0 | [
"Apache-2.0"
] | null | null | null | src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/launch/tabs/LaunchConfigurationExecutorTab.java | alex729/RED | 128bf203cf035892c02805aabd0c915f96006bb0 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2017 Nokia Solutions and Networks
* Licensed under the Apache License, Version 2.0,
* see license.txt file for details.
*/
package org.robotframework.ide.eclipse.main.plugin.launch.tabs;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.robotframework.ide.eclipse.main.plugin.RedImages;
import org.robotframework.ide.eclipse.main.plugin.launch.LaunchConfigurationsWrappers;
import org.robotframework.ide.eclipse.main.plugin.launch.local.RobotLaunchConfiguration;
import org.robotframework.ide.eclipse.main.plugin.launch.tabs.LaunchConfigurationTabValidator.LaunchConfigurationValidationException;
import org.robotframework.ide.eclipse.main.plugin.launch.tabs.LaunchConfigurationTabValidator.LaunchConfigurationValidationFatalException;
import org.robotframework.red.graphics.ImagesManager;
import org.robotframework.red.jface.dialogs.DetailedErrorDialog;
/**
* @author bembenek
*/
class LaunchConfigurationExecutorTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationTab {
private InterpretersComposite interpretersComposite;
private AdditionalArgumentsComposite interpreterArgumentsComposite;
private ExecutableFileComposite executableFileComposite;
private AdditionalArgumentsComposite executableFileArgumentsComposite;
@Override
public void setDefaults(final ILaunchConfigurationWorkingCopy configuration) {
try {
LaunchConfigurationsWrappers.robotLaunchConfiguration(configuration).fillDefaults();
} catch (final CoreException e) {
DetailedErrorDialog.openErrorDialog("Problem with Launch Configuration",
"RED was unable to load the working copy of Launch Configuration.");
}
}
@Override
public void initializeFrom(final ILaunchConfiguration configuration) {
final RobotLaunchConfiguration robotConfig = new RobotLaunchConfiguration(configuration);
try {
interpretersComposite.setInput(robotConfig.isUsingInterpreterFromProject(), robotConfig.getInterpreter());
interpreterArgumentsComposite.setInput(robotConfig.getInterpreterArguments());
executableFileComposite.setInput(robotConfig.getExecutableFilePath());
executableFileArgumentsComposite.setInput(robotConfig.getExecutableFileArguments());
} catch (final CoreException e) {
setErrorMessage("Invalid launch configuration: " + e.getMessage());
}
}
@Override
public void performApply(final ILaunchConfigurationWorkingCopy configuration) {
final RobotLaunchConfiguration robotConfig = new RobotLaunchConfiguration(configuration);
try {
robotConfig.setUsingInterpreterFromProject(interpretersComposite.isUsingProjectInterpreter());
robotConfig.setInterpreter(interpretersComposite.getChosenSystemExecutor());
robotConfig.setInterpreterArguments(interpreterArgumentsComposite.getArguments());
robotConfig.setExecutableFilePath(executableFileComposite.getSelectedExecutableFilePath());
robotConfig.setExecutableFileArguments(executableFileArgumentsComposite.getArguments());
} catch (final CoreException e) {
DetailedErrorDialog.openErrorDialog("Problem with Launch Configuration",
"RED was unable to load the working copy of Launch Configuration.");
}
}
@Override
public boolean isValid(final ILaunchConfiguration configuration) {
setErrorMessage(null);
setWarningMessage(null);
final RobotLaunchConfiguration robotConfig = new RobotLaunchConfiguration(configuration);
try {
new LaunchConfigurationTabValidator().validateExecutorTab(robotConfig);
} catch (final LaunchConfigurationValidationException e) {
setWarningMessage(e.getMessage());
} catch (final LaunchConfigurationValidationFatalException e) {
setErrorMessage(e.getMessage());
return false;
}
return true;
}
@Override
public String getName() {
return "Executor";
}
@Override
public Image getImage() {
return ImagesManager.getImage(RedImages.getScriptRobotImage());
}
@Override
public boolean canSave() {
return true;
}
@Override
public String getMessage() {
return "Edit interpreter parameters for launch configuration";
}
@Override
public void createControl(final Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(composite);
createInterpreterGroup(composite);
createExecutableFileGroup(composite);
setControl(composite);
}
private void createInterpreterGroup(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
group.setText("Interpreter");
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
GridLayoutFactory.fillDefaults().spacing(2, 2).margins(0, 3).extendedMargins(0, 0, 0, 20).applyTo(group);
interpretersComposite = new InterpretersComposite(group, () -> updateLaunchConfigurationDialog());
GridDataFactory.fillDefaults().grab(true, false).applyTo(interpretersComposite);
final Label interpreterArgumentsDescription = new Label(group, SWT.WRAP);
interpreterArgumentsDescription.setText("Additional interpreter arguments:");
GridDataFactory.fillDefaults().grab(true, false).applyTo(interpreterArgumentsDescription);
interpreterArgumentsComposite = new AdditionalArgumentsComposite(group, e -> updateLaunchConfigurationDialog());
GridDataFactory.fillDefaults().grab(true, false).applyTo(interpreterArgumentsComposite);
}
private void createExecutableFileGroup(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
group.setText("External script");
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
GridLayoutFactory.fillDefaults().spacing(2, 2).margins(0, 3).applyTo(group);
final Label executableFileDescription = new Label(group, SWT.WRAP);
executableFileDescription.setText("Executable file to run Robot Framework tests:");
GridDataFactory.fillDefaults().grab(true, false).applyTo(executableFileDescription);
executableFileComposite = new ExecutableFileComposite(group, e -> updateLaunchConfigurationDialog());
GridDataFactory.fillDefaults().grab(true, false).applyTo(executableFileComposite);
final Label executableFileArgumentsDescription = new Label(group, SWT.WRAP);
executableFileArgumentsDescription.setText(
"Additional executable file arguments. Python interpreter's and Robot parameters will be added afterwards.");
GridDataFactory.fillDefaults().grab(true, false).applyTo(executableFileArgumentsDescription);
executableFileArgumentsComposite = new AdditionalArgumentsComposite(group,
e -> updateLaunchConfigurationDialog());
GridDataFactory.fillDefaults().grab(true, false).applyTo(executableFileArgumentsComposite);
}
}
| 45.576471 | 138 | 0.748451 |
c30b171ef545b4d7b13eae9d2feb85ace2994720 | 2,385 | go | Go | notaryapi/merkle.go | jweden/FactomCode | dfac9708b6f2dcd91db224367ed7c99e8b5c2e41 | [
"MIT"
] | null | null | null | notaryapi/merkle.go | jweden/FactomCode | dfac9708b6f2dcd91db224367ed7c99e8b5c2e41 | [
"MIT"
] | null | null | null | notaryapi/merkle.go | jweden/FactomCode | dfac9708b6f2dcd91db224367ed7c99e8b5c2e41 | [
"MIT"
] | 1 | 2022-03-07T17:07:40.000Z | 2022-03-07T17:07:40.000Z |
package notaryapi
import (
"math"
)
// nextPowerOfTwo returns the next highest power of two from a given number if
// it is not already a power of two. This is a helper function used during the
// calculation of a merkle tree.
func nextPowerOfTwo(n int) int {
// Return the number if it's already a power of 2.
if n&(n-1) == 0 {
return n
}
// Figure out and return the next power of two.
exponent := uint(math.Log2(float64(n))) + 1
return 1 << exponent // 2^exponent
}
// HashMerkleBranches takes two hashes, treated as the left and right tree
// nodes, and returns the hash of their concatenation. This is a helper
// function used to aid in the generation of a merkle tree.
func hashMerkleBranches(left *Hash, right *Hash) *Hash {
// Concatenate the left and right nodes.
var barray []byte = make ([]byte, HashSize * 2)
copy(barray[:HashSize], left.Bytes)
copy(barray[HashSize:], right.Bytes)
newSha := Sha(barray)
return newSha
}
func BuildMerkleTreeStore(hashes []*Hash) (merkles []*Hash) {
// Calculate how many entries are required to hold the binary merkle
// tree as a linear array and create an array of that size.
nextPoT := nextPowerOfTwo(len(hashes))
arraySize := nextPoT*2 - 1
// fmt.Println("hashes.len=", len(hashes), ", nextPoT=", nextPoT, ", array.size=", arraySize)
merkles = make([]*Hash, arraySize)
// Create the base transaction shas and populate the array with them.
//for i, entity := range entities {
//merkles[i] = entity.ShaHash()
//}
copy(merkles[:len(hashes)], hashes[:])
// Start the array offset after the last transaction and adjusted to the
// next power of two.
offset := nextPoT
for i := 0; i < arraySize-1; i += 2 {
switch {
// When there is no left child node, the parent is nil too.
case merkles[i] == nil:
merkles[offset] = nil
// When there is no right child, the parent is generated by
// hashing the concatenation of the left child with itself.
case merkles[i+1] == nil:
newSha := hashMerkleBranches(merkles[i], merkles[i])
merkles[offset] = newSha
// The normal case sets the parent node to the double sha256
// of the concatentation of the left and right children.
default:
newSha := hashMerkleBranches(merkles[i], merkles[i+1])
merkles[offset] = newSha
}
offset++
}
return merkles
}
| 31.8 | 94 | 0.674214 |
75e65371bf509b4a6205ae301d4019c48253dd0b | 8,885 | php | PHP | App/Models/ProductModel.php | mustafa220/eOyuncak | a6031eb2f69e4547e59beb72a4ad08472687ece7 | [
"MIT"
] | null | null | null | App/Models/ProductModel.php | mustafa220/eOyuncak | a6031eb2f69e4547e59beb72a4ad08472687ece7 | [
"MIT"
] | null | null | null | App/Models/ProductModel.php | mustafa220/eOyuncak | a6031eb2f69e4547e59beb72a4ad08472687ece7 | [
"MIT"
] | 1 | 2017-11-12T18:20:12.000Z | 2017-11-12T18:20:12.000Z | <?php
namespace App\Models;
use System\Libraries\Model;
use System\Libraries\Config;
use IOModel as io;
class ProductModel extends Model{
function create(){
$userId = $_SESSION["userId"];
$newProduct = $this->db->table("urunler")->insert([
"UyeId" => $userId
]);
return $this->db->insertId();
}
function newCategory($categoryName = "",$sub = 0){
return $this->db->table("kategoriler")->insert([
"KategoriAdi" => $categoryName,
"Alt" => $sub,
"Sef" => sefLink($categoryName),
"Sira" => 0
]);
}
function getCategory($categoryId = 0){
return $this->db->table("kategoriler")->select("*")->where("KategoriId",$categoryId)->get();
}
function updateCategory($categoryId = 0,$newName = ""){
return $this->db->table("kategoriler")->where("KategoriId",$categoryId)->update(["KategoriAdi" => $newName]);
}
function getCategoryFromSefLink($sefLink = ""){
if($sefLink == sefLink($sefLink)){
return $this->db->table("kategoriler")->select("*")->where("Sef",sefLink($sefLink))->get();
}
return ["error" => 1,"errorMessage" => "Hatalı sef link"];
}
function getFromCategory($categoryId = 0){
$getDownIds = $this->getDownCategoryIds($categoryId);
$getDownIds[] = $categoryId;
for($i=0;$i<count($getDownIds);$i++){
$getDownIds[$i] = "urunler.KategoriId='".$getDownIds[$i]."'";
}
$whereString = "WHERE ".implode(" OR ",$getDownIds);
$sql = "SELECT * FROM urunler INNER JOIN urunresimler ON urunresimler.UrunId=urunler.UrunId ".$whereString;
$products = $this->db->query($sql);
return $products;
}
function getDownCategoryIds($categoryId,$array = []){
$category = $this->getCategory($categoryId);
$alts = $this->db->table("kategoriler")->select("KategoriId,Alt")->where("Alt",$categoryId)->getAll();
foreach($alts as $alt){
$array[] = intval($alt->KategoriId);
$array = $this->getDownCategoryIds($alt->KategoriId,$array);
}
return $array;
}
function getCategories($sub = 0){
return $this->db->table("kategoriler")->select("*")->where("Alt",$sub)->orderBy("sira","ASC")->getAll();
}
function getProductTypes($categoryId = 0){
return $this->db->table("uruntipler")->select("*")->where("KategoriId",$categoryId)->getAll();
}
function getProductDetails($productType = 0){
return $this->db->table("urunozellikler")->select("*")->where("UrunTipId",$productType)->getAll();
}
function getProductTypeDetailList($detailId = 0){
return $this->db->table("urunozellikliste")->select("*")->where("UrunOzellikId",$detailId)->getAll();
}
function updateProductStandart($productId = 0,$userId = 0,$data=[]){
$this->db->table("urunler")->where("UrunId",$productId)->where("UyeId",$userId)->update($data);
return [
"error" => 0,
"errorMessage" => "Bilgiler Güncellendi"
];
}
function updateProductAdvanced($productId = 0,$userId = 0,$data){
$control = $this->db->table("urunler")->select("UrunId,UrunTip")->where("UrunId",$productId)->where("UyeId",$userId)->get();
if(count($control) > 0){
foreach($data as $key => $value){
$selectProductDetail = $this->db->table("urunozellikler")->select("*")->where("OzellikId",intval($key))->where("UrunTipId",$control->UrunTip)->getAll();
if(count($selectProductDetail) > 0){
foreach($selectProductDetail as $selectedDetail){
$selectProductValue = $this->db->table("urunozellikdegerler")->select("OzellikDegerId")->where("UrunId",$productId)->where("OzellikId",intval($key))->get();
if($selectedDetail->OzellikTip == 0){
$newValue = toHtmlChars($value);
}
else if($selectedDetail->OzellikTip == 1){
$newValue = intval($value);
}
if(count($selectProductValue) > 0){
$this->db->table("urunozellikdegerler")->where("UrunId",$productId)->where("OzellikId",intval($key))->update(["OzellikDeger" => $newValue]);
}
else{
$this->db->table("urunozellikdegerler")->insert(["UrunId" => $productId,"OzellikId" => $key, "OzellikDeger" => $newValue]);
}
}
}
else{
return [
"error" => 2,
"errorMessage" => "Ürüne ait olmayan özellik eklenmeye çalışılıyor"
];
}
}
return [
"error" => 0,
"errorMessage" => "Bilgiler Güncellendi"
];
}
else{
return [
"error" => 1,
"errorMessage" => "Bu ürün bu üyeye ait değil"
];
}
}
function delete($productId = 0,$userId = 0){
$control = $this->db->table("urunler")->where("UrunId",$productId)->where("UyeId",$userId)->get();
if(count($control) > 0){
$this->db->table("urunler")->where("UrunId",$productId)->delete();
$this->db->table("urunozellikdegerler")->where("UrunId",$productId)->delete();
$productImages = $this->db->table("urunresimler")->select("ResimYol")->where("UrunId",$productId)->getAll();
foreach($productImages as $p){
unlink(PATH."/App/Front/images/productImages/".$p->ResimYol);
$this->db->table("urunresimler")->where("UrunId",$productId)->delete();
}
return [
"error" => 0,
"errorMessage" => "Ürün başarıyla silindi."
];
}
else{
return [
"error" => 1,
"errorMessage" => "Bu üye bu ürünü silemez"
];
}
}
function get($productId = 0){
return $this->
db->
table("urunler")->
select("*")->
innerJoin("urunresimler","urunresimler.UrunId","urunler.UrunId")->
where("urunler.UrunId",$productId)->
get();
}
function getKayit0($productId = 0){
return $this->
db->
table("urunler")->
select("*")->
where("urunler.UrunId",$productId)->
get();
}
function query($sql){
return $this->db->query($sql);
}
function getAll(){
return $this->
db->
table("urunler")->
select("*")->
innerJoin("uyeler","uyeler.UyeId","urunler.UyeId")->
innerJoin("urunresimler","urunresimler.UrunId","urunler.UrunId")->
getAll();
}
function insertImageToProduct($productId = 0,$imgFile = ""){
$newFileName = $this->randomFileName().".png";
if(file_exists($imgFile)){
copy($imgFile,PATH."/App/Front/images/productImages/".$newFileName);
$this->db->table("urunresimler")->insert(["UrunId" => $productId,"ResimYol" => $newFileName]);
if($this->db->insertId() > 0){
return [
"error" => 0,
"errorMessage" => "Resim ürüne başarıyla eklendi"
];
}
return [
"error" => 1,
"errorMessage" => "Resim ürüne eklenemedi"
];
}
return [
"error" => 1,
"errorMessage" => "Resim bulunamadı"
];
}
function randomFileName($Size = 0){
$abc = "ABCDEFGHIJKLMNOPRSTUVYZWXQ";
$numbers = "0123456789";
$Text = "";
if($Size == 0){
$Size = 8; // Default
}
for($i=0;$i<=$Size;$i++){
$Rand1 = rand(0,1);
if($Rand1 == 0){
$Text.= $abc[rand(0,strlen($abc)-1)];
}
else{
$Text.= $numbers[rand(0,strlen($numbers)-1)];
}
}
if(file_exists(PATH."/App/Front/images/productImages/".$Text.".png")){
return randomFileName();
}
return $Text;
}
function deleteCategory($categoryId = 0){
$products = $this->db->table("urunler")->select("UrunId")->where("KategoriId",$categoryId)->getAll();
foreach($products as $p){
$this->delete($p->UrunId);
}
$subCategories = $this->db->table("kategoriler")->select("KategoriId")->where("Alt",$categoryId)->getAll();
foreach($subCategories as $sub){
$this->deleteCategory($sub->KategoriId);
}
$this->db->table("kategoriler")->where("KategoriId",$categoryId)->delete();
}
function mostPays(){
return $this->db->table("urunler")->select("*")->orderBy("urunler.ToplamSatinAlinma","DESC")->limit(15)->innerJoin("urunresimler","urunler.UrunId","urunresimler.UrunId")->getAll();
}
function kategoriBul($kategoriId){
$p=new ProductModel;
if($p->getCategory($kategoriId)->Alt!=0){
return $this->kategoriBul($p->getCategory($kategoriId)->Alt);
}
return $p->getCategory($kategoriId)->Sef;
}
function addNewProductType($typeName = "",$catId = 0){
$this->db->table("uruntipler")->insert([
"KategoriId" => intval($catId),
"UrunTipAdi" => toHtmlChars($typeName)
]);
return $this->db->insertId();
}
function addFeatureToProductType($UrunTipId,$OzellikAdi,$Cins,$degerler){
$OzellikTip = 0;
if(count($degerler) > 0){
$OzellikTip = 1;
}
$add = $this->db->table("urunozellikler")->insert([
"UrunTipId" => $UrunTipId,
"OzellikAdi" => $OzellikAdi,
"Cins" => $Cins,
"OzellikTip" => $OzellikTip,
]);
if($OzellikTip == 1){
$newFeatureId = $this->db->insertId();
if($newFeatureId > 0){
for($i = 0; $i<count($degerler);$i++){
$this->db->table("urunozellikliste")->insert([
"UrunOzellikId" => $newFeatureId,
"Ozellik" => $degerler[$i]
]);
}
return true;
}
return false;
}
return true;
}
}
?> | 33.655303 | 183 | 0.607428 |
74dcf809bdd64b2a05c5caeb9e7889c2afafbb8b | 1,614 | js | JavaScript | test/sjcl-ecdsa-canonical-test.js | stm-open/stmjs | 15580c26e296ddabee7eeda4cd0e13bb8c59d88f | [
"MIT"
] | null | null | null | test/sjcl-ecdsa-canonical-test.js | stm-open/stmjs | 15580c26e296ddabee7eeda4cd0e13bb8c59d88f | [
"MIT"
] | null | null | null | test/sjcl-ecdsa-canonical-test.js | stm-open/stmjs | 15580c26e296ddabee7eeda4cd0e13bb8c59d88f | [
"MIT"
] | null | null | null | var assert = require('assert');
var utils = require('./testutils');
var sjcl = require('../build/sjcl');
var Seed = require('../src/js/stream/seed').Seed;
describe('SJCL ECDSA Canonicalization', function() {
describe('canonicalizeSignature', function() {
it('should canonicalize non-canonical signatures', function () {
var seed = Seed.from_json('shi4r1PZk2osqQDoKdQm82ENXQso7');
var key = seed.get_key('v96F3qes4tqCc1TCXrzeKnL7arKrwDXq5V');
var rs = sjcl.codec.hex.toBits("27ce1b914045ba7e8c11a2f2882cb6e07a19d4017513f12e3e363d71dc3fff0fb0a0747ecc7b4ca46e45b3b32b6b2a066aa0249c027ef11e5bce93dab756549c");
rs = sjcl.ecc.ecdsa.secretKey.prototype.canonicalizeSignature.call(key._secret, rs);
assert.strictEqual(sjcl.codec.hex.fromBits(rs), "27ce1b914045ba7e8c11a2f2882cb6e07a19d4017513f12e3e363d71dc3fff0f4f5f8b813384b35b91ba4c4cd494d5f8500eb84aacc9af1d6403cab218dfeca5");
});
it('should not touch canonical signatures', function () {
var seed = Seed.from_json('shi4r1PZk2osqQDoKdQm82ENXQso7');
var key = seed.get_key('v96F3qes4tqCc1TCXrzeKnL7arKrwDXq5V');
var rs = sjcl.codec.hex.toBits("5c32bc2b4d34e27af9fb66eeea0f47f6afb3d433658af0f649ebae7b872471ab7d23860688aaf9d8131f84cfffa6c56bf9c32fd8b315b2ef9d6bcb243f7a686c");
rs = sjcl.ecc.ecdsa.secretKey.prototype.canonicalizeSignature.call(key._secret, rs);
assert.strictEqual(sjcl.codec.hex.fromBits(rs), "5c32bc2b4d34e27af9fb66eeea0f47f6afb3d433658af0f649ebae7b872471ab7d23860688aaf9d8131f84cfffa6c56bf9c32fd8b315b2ef9d6bcb243f7a686c");
});
});
});
// vim:sw=2:sts=2:ts=8:et
| 55.655172 | 186 | 0.781908 |
4047eb1d781c8526a98f69d37582b323b2265cfd | 910 | py | Python | 4. Weekday_Data wk5.py | colmhiggs11/Prog-Scrip-Problems | 64503965cf8d40ed4e46d4710df4f790f2d5ccc4 | [
"MIT"
] | null | null | null | 4. Weekday_Data wk5.py | colmhiggs11/Prog-Scrip-Problems | 64503965cf8d40ed4e46d4710df4f790f2d5ccc4 | [
"MIT"
] | 1 | 2020-04-29T17:54:20.000Z | 2020-04-29T17:54:20.000Z | 4. Weekday_Data wk5.py | colmhiggs11/Prog-Scrip-Problems | 64503965cf8d40ed4e46d4710df4f790f2d5ccc4 | [
"MIT"
] | null | null | null | # Colm Higgins
# Program to output whether or not today is a weekday or weekend.
# There are no date types in python but by importing the datetime module
# dates can be used as objects.
import datetime
# This will get the current date
datetime.datetime.now()
# Assigning that value to "now"
now = datetime.datetime.now()
# Assigning the value of the weekday to "tday"
tday = now.weekday()
# Values of weekend days are as follows [Saturday,Sunday] = [5,6]
# Values of weekdays are as follows [Monday,..,Friday] = [0,..,4]
if tday >= 5:
tday = "weekend"
# Will print if value for a >=5
print("Thank God it's the",tday)
elif tday <= 4:
tday = "weekday"
# Will print if a <= 4 and will also print "a" underlined
# https://stackoverflow.com/questions/35401019/how-do-i-print-something-underlined-in-python
print("Unfortunately today is tday","\u0332".join(tday))
| 36.4 | 96 | 0.685714 |
a25b9a8bb5fd140a54544a87b002befcbc91c29b | 1,280 | swift | Swift | AlgorithmPractice/DataStruct/Queue/CircleQueue.swift | yangchao0033/ALGOPractice | 124c2a61d8ec672603df72ec4dbb1e107bf9cf2b | [
"MIT"
] | null | null | null | AlgorithmPractice/DataStruct/Queue/CircleQueue.swift | yangchao0033/ALGOPractice | 124c2a61d8ec672603df72ec4dbb1e107bf9cf2b | [
"MIT"
] | null | null | null | AlgorithmPractice/DataStruct/Queue/CircleQueue.swift | yangchao0033/ALGOPractice | 124c2a61d8ec672603df72ec4dbb1e107bf9cf2b | [
"MIT"
] | null | null | null | //
// CircleQueue.swift
// AlgorithmPractice
//
// Created by 超杨 on 2020/8/19.
// Copyright © 2020 superYang. All rights reserved.
//
import Cocoa
class CircleQueue {
static let maxSize = 100
var data = [Int](repeating: 0, count: maxSize)
var front = 0
var rear = 0
init() {
}
func clear() {
front = 0
rear = 0
}
var maxSize: Int {
return CircleQueue.maxSize
}
var isEmpty: Bool {
return front == rear
}
var length: Int {
return (front - rear + maxSize) % maxSize
}
var head: Int? {
guard !isEmpty else {
return nil
}
return data[front]
}
func travel() {
var p = front
while p != rear {
p = (p + 1) % maxSize
}
print(p)
}
func put(_ e: Int) {
guard !isFull else {
return
}
data[rear] = e
rear = (rear + 1) % maxSize
}
func poll() -> Int? {
guard !isEmpty else {
return nil
}
let q = data[front]
front = (front + 1) % maxSize
return q
}
private var isFull: Bool {
return (rear + 1) % maxSize == front
}
}
| 17.534247 | 52 | 0.459375 |
5528f729d9bd514c5c2c4f7353c292191ad656f7 | 1,127 | swift | Swift | RouteTracker/UI/Views/CustomeView.swift | djestat/RouteTracker | 14bd26979b44d290abe21774815a777d19a31229 | [
"Unlicense"
] | 1 | 2022-01-31T17:17:36.000Z | 2022-01-31T17:17:36.000Z | RouteTracker/UI/Views/CustomeView.swift | djestat/RouteTracker | 14bd26979b44d290abe21774815a777d19a31229 | [
"Unlicense"
] | null | null | null | RouteTracker/UI/Views/CustomeView.swift | djestat/RouteTracker | 14bd26979b44d290abe21774815a777d19a31229 | [
"Unlicense"
] | null | null | null | //
// CustomeView.swift
// RouteTracker
//
// Created by Igor on 15.08.2020.
// Copyright © 2020 Igor Gapanovich. All rights reserved.
//
import UIKit
class CustomeView: UIView {
let pathDrawer = ViewPathDrawing()
override init(frame: CGRect) {
super.init(frame: frame)
setup(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
print("Error!")
}
func setup(frame: CGRect) {
// Create a CAShapeLayer
let shapeLayer = CAShapeLayer()
// The Bezier path that we made needs to be converted to
// a CGPath before it can be used on a layer.
// shapeLayer.path = pathDrawer.createSubviewBezierPath(UIView, UIView, UIView, UIView).cgPath
// apply other properties related to the path
shapeLayer.strokeColor = UIColor.blue.cgColor
shapeLayer.fillColor = UIColor.white.cgColor
shapeLayer.lineWidth = 1.0
shapeLayer.position = CGPoint(x: 10, y: 10)
// add the new layer to our custom view
self.layer.addSublayer(shapeLayer)
}
}
| 25.613636 | 101 | 0.636202 |
26925ebc529bb1326f2ffeadf0f21032375bdac4 | 3,887 | java | Java | server/src/main/java/bio/knowledge/server/api/ExactmatchesApi.java | meera-gd/ndex | eede8627447900b19d17cec5d5c57a2a12ca5247 | [
"MIT"
] | null | null | null | server/src/main/java/bio/knowledge/server/api/ExactmatchesApi.java | meera-gd/ndex | eede8627447900b19d17cec5d5c57a2a12ca5247 | [
"MIT"
] | null | null | null | server/src/main/java/bio/knowledge/server/api/ExactmatchesApi.java | meera-gd/ndex | eede8627447900b19d17cec5d5c57a2a12ca5247 | [
"MIT"
] | null | null | null | package bio.knowledge.server.api;
import io.swagger.annotations.*;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import javax.validation.constraints.*;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-06-26T09:57:13.188-07:00")
@Api(value = "exactmatches", description = "the exactmatches API")
public interface ExactmatchesApi {
@ApiOperation(value = "", notes = "Retrieves a list of qualified identifiers of \"exact match\" concepts, [sensa SKOS](http://www.w3.org/2004/02/skos/core#exactMatch) associated with a specified (url-encoded) CURIE (without brackets) concept object identifier, typically, of a concept selected from the list of concepts originally returned by a /concepts API call on a given KS. ", response = String.class, responseContainer = "List", tags={ "exactmatches", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response returns a set of [CURIE](https://www.w3.org/TR/curie/) identifiers to 3rd party concepts defined outside of the local KS, which are deemed semantic exact matches [*sensa*-SKOS](http://www.w3.org/2004/02/skos/core#exactMatch) to the specified identified concept (maybe an empty set?) ", response = String.class) })
@RequestMapping(value = "/exactmatches/{conceptId}",
produces = { "application/json" },
method = RequestMethod.GET)
ResponseEntity<List<String>> getExactMatchesToConcept(@ApiParam(value = "(url-encoded) CURIE identifier of the concept to be matched",required=true ) @PathVariable("conceptId") String conceptId);
@ApiOperation(value = "", notes = "Given an input list of [CURIE](https://www.w3.org/TR/curie/) identifiers of known exactly matched concepts [*sensa*-SKOS](http://www.w3.org/2004/02/skos/core#exactMatch), retrieves the list of [CURIE](https://www.w3.org/TR/curie/) identifiers of **additional** concepts that are deemed by the given knowledge source to be exact matches to one or more of the input concepts. If an empty set is returned, the it can be assumed that the given knowledge source does not know of any new equivalent concepts to add to the input set. ", response = String.class, responseContainer = "List", tags={ "exactmatches", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response returns a set of [CURIE-encoded](https://www.w3.org/TR/curie/) identifiers of concepts (with supporting evidence code and reference) matching at least one identifier in the input list of known exactly matched concepts [*sensa*-SKOS](http://www.w3.org/2004/02/skos/core#exactMatch). Each concept identifier is returned with the full list of any additional associated [CURIE-encoded](https://www.w3.org/TR/curie/) identifiers of exact match concepts known to the given Knowledge Source. ", response = String.class) })
@RequestMapping(value = "/exactmatches",
produces = { "application/json" },
method = RequestMethod.GET)
ResponseEntity<List<String>> getExactMatchesToConceptList( @NotNull @ApiParam(value = "set of [CURIE-encoded](https://www.w3.org/TR/curie/) identifiers of exactly matching concepts, to be used in a search for additional exactly matching concepts [*sensa*-SKOS](http://www.w3.org/2004/02/skos/core#exactMatch). ", required = true) @RequestParam(value = "c", required = true) List<String> c);
}
| 97.175 | 648 | 0.758426 |
28dc2bebe774026c6892ea8a2c25c909506b611c | 64 | jbuilder | Ruby | app/views/acticles/index.json.jbuilder | dnhthooi/blog_markdown | bf0e5d1667fed29988cd47ee68376817ba386df4 | [
"Apache-2.0"
] | null | null | null | app/views/acticles/index.json.jbuilder | dnhthooi/blog_markdown | bf0e5d1667fed29988cd47ee68376817ba386df4 | [
"Apache-2.0"
] | null | null | null | app/views/acticles/index.json.jbuilder | dnhthooi/blog_markdown | bf0e5d1667fed29988cd47ee68376817ba386df4 | [
"Apache-2.0"
] | null | null | null | json.array! @acticles, partial: 'acticles/acticle', as: :acticle | 64 | 64 | 0.75 |
0cae22d507612da85bffdebd4c0b6e85283e36dc | 2,621 | kt | Kotlin | libraries/VastSwipeListView/src/main/java/com/gcode/vastswipelistview/adapter/VastMergeListItemAdapter.kt | SakurajimaMaii/GUtils | 545dc2bab4653b7647dbb5f426a5e4fe842dfa4d | [
"MIT"
] | 1 | 2021-03-31T03:31:43.000Z | 2021-03-31T03:31:43.000Z | libraries/VastSwipeListView/src/main/java/com/gcode/vastswipelistview/adapter/VastMergeListItemAdapter.kt | SakurajimaMaii/GStyleUtils | 545dc2bab4653b7647dbb5f426a5e4fe842dfa4d | [
"MIT"
] | 1 | 2021-03-31T03:32:00.000Z | 2021-03-31T03:32:00.000Z | libraries/VastSwipeListView/src/main/java/com/gcode/vastswipelistview/adapter/VastMergeListItemAdapter.kt | SakurajimaMaii/GUtils | 545dc2bab4653b7647dbb5f426a5e4fe842dfa4d | [
"MIT"
] | null | null | null | package com.gcode.vastswipelistview.adapter
import android.content.Context
import android.database.DataSetObserver
import android.view.View
import android.view.ViewGroup
import android.widget.ListAdapter
import android.widget.WrapperListAdapter
import com.gcode.vastswipelistview.VastSwipeMenuMgr
import com.gcode.vastswipelistview.view.VastSwipeLeftMenu
import com.gcode.vastswipelistview.view.VastSwipeListItemLayout
import com.gcode.vastswipelistview.view.VastSwipeRightMenu
/**
* @OriginalAuthor: Vast Gui
* @OriginalDate:
* @EditAuthor: Vast Gui
* @EditDate: 2021/11/29
*/
/**
* Vast merge list item adapter
*
* Merge the ContentView and the SwipeMenuLayout to display the menu
*
* @property context Context.
* @property adapter The adapter of the listView.
* @property swipeMenuMgr The swipe menu manager.
*/
internal open class VastMergeListItemAdapter(
private val context: Context,
private val adapter: ListAdapter,
private val swipeMenuMgr: VastSwipeMenuMgr
) : WrapperListAdapter {
override fun getCount() = adapter.count
override fun getItem(position: Int): Any = adapter.getItem(position)
override fun getItemId(position: Int) = adapter.getItemId(position)
override fun registerDataSetObserver(observer: DataSetObserver?) {
adapter.registerDataSetObserver(observer)
}
override fun unregisterDataSetObserver(observer: DataSetObserver?) {
adapter.unregisterDataSetObserver(observer)
}
override fun areAllItemsEnabled() = adapter.areAllItemsEnabled()
override fun isEnabled(position: Int) = adapter.isEnabled(position)
override fun hasStableIds() = adapter.hasStableIds()
override fun getItemViewType(position: Int) = adapter.getItemViewType(position)
override fun getViewTypeCount() = adapter.viewTypeCount
override fun isEmpty() = adapter.isEmpty
override fun getWrappedAdapter() = adapter
override fun getView(
position: Int,
convertView: View?,
parent: ViewGroup
): VastSwipeListItemLayout? {
return if (convertView == null) {
val contentView = adapter.getView(position, null, parent)
val leftMenuView = VastSwipeLeftMenu(swipeMenuMgr)
val rightMenuView = VastSwipeRightMenu(swipeMenuMgr)
VastSwipeListItemLayout(
contentView, leftMenuView, rightMenuView, swipeMenuMgr
).apply {
setPosition(position)
}
} else {
(convertView as VastSwipeListItemLayout).apply {
setPosition(position)
}
}
}
} | 31.202381 | 83 | 0.719573 |
0ef90a33dbf11f8606bf553d9cabbc74344e2e2e | 5,871 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2.log_21829_1415.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2.log_21829_1415.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2.log_21829_1415.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r15
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x795d, %r15
nop
dec %r10
mov $0x6162636465666768, %r12
movq %r12, %xmm6
movups %xmm6, (%r15)
nop
nop
inc %r13
lea addresses_normal_ht+0x191e9, %rsi
lea addresses_D_ht+0x130bd, %rdi
sub $9763, %r10
mov $67, %rcx
rep movsl
nop
xor $2937, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r8
push %rax
push %rbp
push %rbx
push %rdi
// Store
mov $0x70d, %r11
nop
nop
add %rdi, %rdi
movb $0x51, (%r11)
nop
nop
nop
nop
and %rax, %rax
// Store
lea addresses_WC+0x325d, %rax
nop
nop
nop
nop
nop
sub %r12, %r12
mov $0x5152535455565758, %rdi
movq %rdi, (%rax)
nop
nop
nop
add $4463, %r8
// Store
lea addresses_UC+0x10cdd, %r12
nop
nop
nop
nop
nop
xor $16626, %r11
mov $0x5152535455565758, %r8
movq %r8, (%r12)
add $705, %rbx
// Load
lea addresses_RW+0x3de5, %r12
nop
nop
nop
nop
nop
and $5492, %rbp
mov (%r12), %rdi
nop
nop
nop
sub $33838, %rbx
// Load
lea addresses_WC+0x86a1, %r11
nop
nop
nop
nop
nop
and %rax, %rax
movb (%r11), %r12b
nop
nop
nop
sub %r8, %r8
// Store
lea addresses_D+0x1d15d, %r11
nop
nop
nop
nop
nop
and $18495, %rdi
movl $0x51525354, (%r11)
nop
nop
nop
nop
and $13265, %rdi
// Faulty Load
mov $0x4a1fbb000000095d, %rax
nop
nop
nop
dec %rbp
mov (%rax), %r12w
lea oracles, %rax
and $0xff, %r12
shlq $12, %r12
mov (%rax,%r12,1), %r12
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 35.581818 | 2,999 | 0.654233 |
6d48aecd58c5227990e58a9b300ec4698c810615 | 1,364 | swift | Swift | RxHttpClientTests/NSURLTests.swift | RxSwiftCommunity/RxHttpClient | 7048f21f14d26bc326065760926e2d680a18b1da | [
"MIT"
] | 37 | 2016-12-22T09:20:56.000Z | 2022-03-26T17:04:31.000Z | RxHttpClientTests/NSURLTests.swift | RxSwiftCommunity/RxHttpClient | 7048f21f14d26bc326065760926e2d680a18b1da | [
"MIT"
] | 14 | 2016-12-20T19:37:59.000Z | 2019-02-25T17:15:54.000Z | RxHttpClientTests/NSURLTests.swift | RxSwiftCommunity/RxHttpClient | 7048f21f14d26bc326065760926e2d680a18b1da | [
"MIT"
] | 8 | 2016-12-22T09:21:00.000Z | 2021-05-20T16:49:34.000Z | import XCTest
@testable import RxHttpClient
class NSURLTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testCreateNSURLWithParameters() {
let url = URL(baseUrl: "http://test.com", parameters: ["param1": "value1"])
XCTAssertEqual(url?.absoluteString, "http://test.com?param1=value1")
}
func testCreateNSURLWithEscapedParameters() {
let url = URL(baseUrl: "http://test.com", parameters: ["param1": "\"#%<>\\^`{|}"])
XCTAssertEqual(url?.absoluteString, "http://test.com?param1=%22%23%25%3C%3E%5C%5E%60%7B%7C%7D")
}
func testCreateNSURLWithoutParameters() {
let url = URL(baseUrl: "http://test.com", parameters: nil)
XCTAssertEqual(url?.absoluteString, "http://test.com")
}
func testNotCreateNSURL() {
let url = URL(baseUrl: "some string", parameters: ["param1": "value1", "param2": "value2"])
XCTAssertNil(url)
}
func testSha1() {
XCTAssertEqual("72fe95c5576ec634e214814a32ab785568eda76a", URL(baseUrl: "https://google.com")?.sha1())
XCTAssertEqual("72fe95c5576ec634e214814a32ab785568eda76a", URL(baseUrl: "https://Google.coM")?.sha1())
}
}
| 33.268293 | 105 | 0.706012 |
cb5f8fc06dc562c7566a2c6729c246129567e48d | 7,902 | html | HTML | index.html | michaelperez08/muebleriaarroyowebpage | f0b5ce8affb29a0f7ddbf9dd5790a9937dc95334 | [
"MIT"
] | null | null | null | index.html | michaelperez08/muebleriaarroyowebpage | f0b5ce8affb29a0f7ddbf9dd5790a9937dc95334 | [
"MIT"
] | null | null | null | index.html | michaelperez08/muebleriaarroyowebpage | f0b5ce8affb29a0f7ddbf9dd5790a9937dc95334 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta name="description" content="Mueblería Arroyo Sarchí, Fabricantes de Muebles">
<meta name="keywords" content="Muebles,Muebleria,Arroyo,Sarchi,Forniture">
<meta name="author" content="Michael Pérez">
<meta property="og:image" content="http://muebleriaarroyosarchi.com/img/pagescreen.png"/>
<link rel="icon" href="img/LogoMueblería-01.png">
<title>Mueblería Arroyo</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
</head>
<body>
<nav class="transparent" role="navigation" style="position:absolute; z-index:1000;">
<div class="nav-wrapper container"><a id="logo-container" href="index.html" class="brand-logo"><i class="tiny material-icons left"><img src="img/LogoMueblería-01.png" class="responsive-img logo-muebleria"></i></a>
<ul class="right hide-on-med-and-down">
<li><a href="index.html"><i class="material-icons left">home</i>Inicio</a></li>
<li><a href="galeria.html"><i class="material-icons left">perm_media</i>Galería</a></li>
<li><a href="ubicacion.html"><i class="material-icons left">room</i>Ubicación</a></li>
<li><a href="cotizacion.php"><i class="material-icons left">receipt</i>Cotizaciones</a></li>
</ul>
<ul id="nav-mobile" class="side-nav">
<li><a href="index.html"><i class="material-icons left">home</i>Inicio</a></li>
<li><a href="galeria.html"><i class="material-icons left">perm_media</i>Galería</a></li>
<li><a href="ubicacion.html"><i class="material-icons left">room</i>Ubicación</a></li>
<li><a href="cotizacion.php"><i class="material-icons left">receipt</i>Cotizaciones</a></li>
</ul>
<a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
</div>
</nav>
<main>
<div class="parallax-container valign-wrapper">
<div class="section no-pad-bot">
<div class="container">
<div class="row center white-text">
<h4>
<span class="bold">Mueblería Arroyo</span>
<span class="thin">le ofrece la mejor calidad en muebles, con los mas novedosos diseños y acabados, finas tallas, y las mas alta calidad en madera, con excelentes precios!.</span>
</h4>
</div>
</div>
</div>
<div class="parallax"><img src="img/sillas.jpg" alt="Unsplashed background img 2"></div>
</div>
<div class="section no-pad-bot" id="index-banner">
<div class="container">
<br><br>
<div class="row center">
<img src="img/LogosConLetras-02.png" class="responsive-img logo">
</div>
<div class="row center">
<h5 class="header col s12 light">Fabricamos muebles desde la cuna de la artesanía, Sarchí.</h5>
</div>
<div class="row center">
<a href="ubicacion.html" id="download-button" class="btn-large waves-effect waves-light teal">Contactenos</a>
</div>
<br><br>
</div>
</div>
<div class="slider">
<ul class="slides row">
<li>
<img src="img/slider-1.jpg"> <!-- random image -->
<div class="caption center-align">
<h3>Todo Tipo de Muebles</h3>
<h5 class="light grey-text text-lighten-3">Para todo el hogar.</h5>
</div>
</li>
<li>
<img src="img/slider-2.jpg"> <!-- random image -->
<div class="caption left-align">
<h3>Diseños Novedos</h3>
<h5 class="light grey-text text-lighten-3">Para todos los gustos.</h5>
</div>
</li>
<li>
<img src="img/slider-3.jpg"> <!-- random image -->
<div class="caption right-align">
<h3>Los Mejores Acabados</h3>
<h5 class="light grey-text text-lighten-3">De la mano de los mejores artesanos.</h5>
</div>
</li>
<li>
<img src="img/slider-4.jpg"> <!-- random image -->
<div class="caption center-align">
<h3>La mejor Calidad en Madera</h3>
<h5 class="light grey-text text-lighten-3">Guanacaste, Cenizaro, etc.</h5>
</div>
</li>
</ul>
</div>
<div class="container">
<div class="section">
<div class="row">
</div>
</div>
<div class="section">
<!-- Icon Section -->
<div class="row">
<div class="col s12 m4">
<div class="icon-block">
<h2 class="center brown-text"><i class="material-icons"><img src="img/arbol.png" class="responsive-img img-info"></i></h2>
<h5 class="center">Madera</h5>
<p class="light center">Elegimos la mejor calidad en madera para producir los mejores muebles.</p>
</div>
</div>
<div class="col s12 m4">
<div class="icon-block">
<h2 class="center brown-text"><i class="material-icons"><img src="img/martillo.png" class="responsive-img img-info"></i></h2>
<h5 class="center">Produccción</h5>
<p class="light center">Contamos con la mejor calidad en todo el proceso de producción y con los mejores artesanos en muebles.</p>
</div>
</div>
<div class="col s12 m4">
<div class="icon-block">
<h2 class="center brown-text"><i class="material-icons"><img src="img/camion.png" class="responsive-img img-info"></i></h2>
<h5 class="center">Entregas</h5>
<p class="light center">Le ofrecemos entregas en casi la totalidad del territorio nacional.</p>
</div>
</div>
</div>
</div>
<br><br>
</div>
</main>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Sobre Nosotros</h5>
<p class="grey-text text-lighten-4">Ubicados en la cuna Artesanía de Costa Rica, en Sarchí, contamos con mas de 20 años de experiencia en la fabricación de muebles,
utilizando las mejores maderas y abacabados, con los mejores precios del mercado. Buscando siempre ofrecer el mejor servicio al cliente para satisfacer sus necesidades, estamos para servirles.</p>
</div>
<div class="col l3 s12">
<h5 class="white-text">Contactenos</h5>
<ul class="contactenos">
<li><a class="grey-text text-lighten-3" href="https://www.facebook.com/muebleriaarroyo/" target="_blank"><i class="tiny material-icons left" style="width:28px;"><img src="img/facebook-2.png" class="responsive-img"></i>facebook</a></li>
<li><a class="grey-text text-lighten-3" href="#!"><i class="small material-icons left">phone</i>2450-2042 / 8810-6833 / 6088-1544</a></li>
<li><a class="grey-text text-lighten-3" href="#!"><i class="small material-icons left">mail</i>muebleriaarroyo@hotmail.es</a></li>
<li><a class="grey-text text-lighten-3" href="#!"><i class="small material-icons left">room</i>Sarchi, Alajuela</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
Made by <a class="teal-text text-lighten-3" href="http://perezmurillo.com">Michael Pérez</a>
</div>
</div>
</footer>
<!-- Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.js"></script>
<script src="js/init.js"></script>
</body>
</html>
| 45.154286 | 247 | 0.596178 |
f834f087adc8864056b36f62a0221beafab5c34c | 570 | kt | Kotlin | step06-creatures-silhouette/src/main/java/tech/salvatore/livro_android_kotlin_paulo_salvatore/viewmodel/UserViewModel.kt | FabricaDeSinapse/livro-android-casa-do-codigo | 29543698aa5e45e62640cc8ffc64b053e6765d98 | [
"MIT"
] | null | null | null | step06-creatures-silhouette/src/main/java/tech/salvatore/livro_android_kotlin_paulo_salvatore/viewmodel/UserViewModel.kt | FabricaDeSinapse/livro-android-casa-do-codigo | 29543698aa5e45e62640cc8ffc64b053e6765d98 | [
"MIT"
] | null | null | null | step06-creatures-silhouette/src/main/java/tech/salvatore/livro_android_kotlin_paulo_salvatore/viewmodel/UserViewModel.kt | FabricaDeSinapse/livro-android-casa-do-codigo | 29543698aa5e45e62640cc8ffc64b053e6765d98 | [
"MIT"
] | null | null | null | package tech.salvatore.livro_android_kotlin_paulo_salvatore.viewmodel
import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import tech.salvatore.livro_android_kotlin_paulo_salvatore.model.repository.UserRepository
import javax.inject.Inject
@HiltViewModel
class UserViewModel @Inject constructor(
private val userRepository: UserRepository,
) : ViewModel() {
val user = userRepository.user
val onChooseCreature = userRepository.onChooseCreature
fun chooseCreature() {
userRepository.chooseCreature()
}
}
| 28.5 | 90 | 0.812281 |
0c8d8ebe08a6b4445a731df985a3abbe390f7b84 | 11,465 | py | Python | src/visaplan/plone/tools/setup/_get_object.py | visaplan/plone.tools | 080da21af710334033540cd2e7e0c63358d234d2 | [
"Apache-2.0"
] | 1 | 2021-01-04T01:30:50.000Z | 2021-01-04T01:30:50.000Z | src/visaplan/plone/tools/setup/_get_object.py | visaplan/plone.tools | 080da21af710334033540cd2e7e0c63358d234d2 | [
"Apache-2.0"
] | null | null | null | src/visaplan/plone/tools/setup/_get_object.py | visaplan/plone.tools | 080da21af710334033540cd2e7e0c63358d234d2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- äöü vim: sw=4 sts=4 et tw=79
"""
Tools für Produkt-Setup (Migrationsschritte, "upgrade steps"): _tree
"""
# Python compatibility:
from __future__ import absolute_import
# Standard library:
from posixpath import normpath
# Zope:
from Products.CMFCore.utils import getToolByName
# Plone:
from plone.uuid.interfaces import IUUID
# Local imports:
from visaplan.plone.tools._have import HAS_SUBPORTALS
from visaplan.plone.tools.setup._args import (
_extract_move_args,
extract_layout_switch,
extract_menu_switch,
)
from visaplan.plone.tools.setup._misc import _traversable_path
from visaplan.plone.tools.setup._o_tools import (
handle_language,
handle_layout,
handle_menu,
handle_title,
make_notes_logger,
)
if HAS_SUBPORTALS:
from visaplan.plone.tools.setup._o_tools import handle_subportal
# Local imports:
from visaplan.plone.tools.setup._reindex import make_reindexer
# Logging / Debugging:
import logging
# Exceptions:
__all__ = [
'make_object_getter',
]
# see also _make_folder.py: make_subfolder_creator
def make_object_getter(context, **kwargs):
"""
Return a function which finds an object ...
- by 'id', if a 'parent' is given;
- by 'uid' (if given);
- by 'path' (relative to the portal object).
Getting the object is the first part only; the function is used to make
sure the object has certain properties as well!
Further understood options are:
- title - a title to be checked and/or set
- language - a language to be checked and/or set
- canonical - an object which was returned by some .getCanonical method
call. Usually requires a language value as well.
- info - a (usually empty) dict; see `return_tuple` below.
Options to the factory:
- keys - the sequence of the keys 'id', 'uid' and 'path',
specifying the order in which they are tried
- verbose - log informations about problems
- logger - a logger to use if verbose
... defaults for the function:
- set_title - set the title (if given and not matching)
- set_uid - set the UUID (if given and not matching)
- set_language - set the language (if given and not matching)
- set_canonical - link the canonical translation (if given)
- reindex - True: reindex in any case,
False: ... under no circumstances,
None: ... if changes were made (default).
- return_tuple - if True, return a 2-tuple (object, info);
by default, only the object (or None) is returned.
Unless return_tuple=True is specified,
the returned function will simply return the object or None;
in this (standard) case, you can deliver the info dictionary yourself,
which will be changed in-place, to get access to the
detailed information, including an "updates" subdict.
The "set_..." options mean, "set the object property", e.g. call
setLanguage if a language key is given and mismatching;
the "get_..." options do the opposite: they write the found value to the
info dictionary, to be more precise: to the info['updates'] dictionary.
Thus, to make use of the get_... results, an "info" dictionary must be
provided.
"""
pop = kwargs.pop
keys = pop('keys', None) or ['path', 'id', 'uid']
parent = pop('parent', None)
portal = getToolByName(context, 'portal_url').getPortalObject()
reference_catalog = getToolByName(context, 'reference_catalog')
verbose = pop('verbose', 1)
if 'logger' in kwargs:
logger = pop('logger')
elif verbose:
logger = logging.getLogger('get_object')
reindexer = kwargs.pop('reindexer', None)
idxs = kwargs.pop('idxs', None)
if reindexer is None and (set_menu is None or set_menu):
reindexer = make_reindexer(logger=logger,
context=parent,
idxs=idxs)
elif reindexer is not None and idxs is not None:
logger.warn('Ignoring idxs value %(idxs)r', locals())
reindex = kwargs.pop('reindex', reindexer is not None
or None)
if reindex and reindexer is None:
reindexer = make_reindexer(logger=logger,
context=parent)
set_title = pop('set_title', True)
set_uid = pop('set_uid', False)
get_uid = pop('get_uid', None)
set_language = pop('set_language', True)
set_canonical = pop('set_canonical', None)
if set_canonical is None:
set_canonical = set_language
set_subportal = pop('set_subportal', None)
subportal = pop('subportal', None)
return_tuple = pop('return_tuple', False)
def _err(msg, notes, logger=logger):
notes.append(('ERROR', msg))
if logger is not None:
logger.error(msg)
def _info(msg, notes, log=True, logger=logger):
notes.append(('INFO', msg))
if log and logger is not None:
logger.info(msg)
def get_object(
id=None, uid=None, path=None,
info=None, # specify an empty dict to get information!
parent=parent,
reindex=reindex,
reindexer=reindexer,
set_title=set_title,
set_uid=set_uid,
get_uid=get_uid,
set_language=set_language,
set_canonical=set_canonical,
set_subportal=set_subportal,
subportal=subportal,
return_tuple=return_tuple,
**kwargs):
"""
This function is designed to be called with keyword arguments only.
In a Python-3-only release of the package, this will be enforced!
"""
if info is None:
info = {}
info.update({
'found': False,
'reindexed': False,
'changes': 0,
'notes': [],
'specs': None, # set to a string below
'updates': {},
})
notes = info['notes']
# for notes from _o_tools.py:
lognotes = make_notes_logger(logger, info['notes'])
updates = info['updates']
tried_keys = set()
o = None
found_by = None
changes = 0
specs = []
for key in keys:
if key in tried_keys:
continue
tried_keys.add(key)
if key == 'id':
if id is not None:
specs.append('id=%(id)r' % locals())
if parent is not None:
o = getattr(parent, id, None)
if o is None:
_err('%(parent)r.%(id)r not found!' % locals(),
notes)
elif key == 'uid':
if uid is not None:
specs.append('uid=%(uid)r' % locals())
o = reference_catalog.lookupObject(uid)
if o is None:
_err('UID %(uid)r not found!' % locals(),
notes)
elif key == 'path':
if path is not None:
specs.append('path=%(path)r' % locals())
if normpath(path) in ('.', '/'):
o = portal
_info('path=%(path)r -> using %(portal)r!' % locals(),
notes)
else:
try:
# restrictedTraverse dislikes leading slashes, at least:
o = portal.restrictedTraverse(_traversable_path(path))
except KeyError:
o = None
if o is None:
_err('%(portal)r[%(path)r] not found!' % locals(),
notes)
else:
_err('Unknown key: %(key)r' % locals(), notes)
if found_by is None and o is not None:
found_by = key
break
info['specs'] = ', '.join(specs) or 'no non-empty specifications!'
if o is None:
return ((o, info) if return_tuple
else o)
info['found'] = True
info['found_by'] = found_by
if found_by == 'uid':
if get_uid >= 2:
updates['uid'] = uid
else:
if get_uid is None:
get_uid = True
if get_uid or uid is not None:
found_uid = IUUID(o, None)
if uid is not None:
if found_uid != uid:
if set_uid:
o._setUID(uid)
_info('%(o)r: old UID %(found_uid)r --> new UID %(uid)r'
% locals(),
notes)
changes += 1
if get_uid:
found_uid = uid
else:
_info('%(o)r: UID %(found_uid)r mismatches %(uid)r'
% locals(),
notes)
else:
_info('%(o)r: checked UID (%(found_uid)r)' % locals(),
notes,
verbose > 1)
if get_uid:
updates['uid'] = found_uid
# ---------- [set_]title:
kwargs.update(set_title=set_title)
ch, notes = handle_title(o, kwargs, created=False)
changes += ch
for tup in notes:
lognotes(tup)
# ---------- [set_]language, [set_]canonical:
kwargs.update(set_language=set_language, set_canonical=set_canonical)
ch, notes = handle_language(o, kwargs, created=False)
changes += ch
for tup in notes:
lognotes(tup)
# ---------- [{set,get}_]layout:
ch, notes, upd = handle_layout(o, kwargs, created=False)
changes += ch
for tup in notes:
lognotes(tup)
updates.update(upd) # might contain a new 'layout' key
# ---------- [switch_]menu:
ch, notes = handle_menu(o, kwargs, created=False)
changes += ch
for tup in notes:
lognotes(tup)
if HAS_SUBPORTALS:
# ---------- [set_]subportal:
kwargs.update(subportal=subportal, set_subportal=set_subportal)
ch, notes = handle_subportal(o, kwargs, created=False)
changes += ch
for tup in notes:
lognotes(tup)
info['changes'] = changes
if reindex is None:
if not changes:
_info('%(o)r not changed and not reindexed' % locals(),
notes)
return ((o, info) if return_tuple
else o)
reindex = True
if not reindex:
if changes:
_info('%(o)r has %(changes)d changes but reindexing suppressed'
% locals(),
notes)
return ((o, info) if return_tuple
else o)
if reindexer is None:
o.reindexObject()
else:
reindexer(o)
info['reindexed'] = True
return ((o, info) if return_tuple
else o)
return get_object
| 35.495356 | 84 | 0.527955 |
1644a074b7479c1cd4fb196de4cd1d5f1202cee3 | 806 | ts | TypeScript | wwwroot/js/Lavine-master/Framework/routesEngine.d.ts | formiga-tecnologia/FOS | 23f14312e1d95f8a56498103615f18cf799a9b68 | [
"MIT"
] | null | null | null | wwwroot/js/Lavine-master/Framework/routesEngine.d.ts | formiga-tecnologia/FOS | 23f14312e1d95f8a56498103615f18cf799a9b68 | [
"MIT"
] | null | null | null | wwwroot/js/Lavine-master/Framework/routesEngine.d.ts | formiga-tecnologia/FOS | 23f14312e1d95f8a56498103615f18cf799a9b68 | [
"MIT"
] | null | null | null | export class Routes{
goToLink(link:any):void
getUpdateRoutes():void
getRouteVars():void
getRoutesOutside(routetarget:any):void
removeVarsOfRoute(route:any):any
registerRoute(routePathRegister:any, compEvent:any):void
runRoute(initialPage:any, InitialPageRedirect:any):voisd
whenUpdate(eventClass:any):void
whenChange(eventClass:any, object:any):void
whenChangeRoute(eventClass:any):void
whenChangeLocation(eventClass:any):void
redirectLocation():void
addEventSync():void
resolveAwait():void
whenAwait(eventClass:any):void
routeExecution(initialpage:any,initialPageRedirect:any):void
registerNest(linkedTo:any,routePathRegister:any,compevent:any,nest:any):void
nestRoutes(targetLocation:any,routeTarget:any,QtdPathNest:any):void
} | 38.380952 | 80 | 0.766749 |
b98256866cf94b9d78d4686823e65102dc7f2e20 | 3,377 | c | C | lib/generateCode/example1/rtos/sdfchannel/sdfchanel.c | Rojods/CInTSyDe | b026d7e59b7707b0d43032a74a085875b43dd281 | [
"MIT"
] | 1 | 2022-03-29T13:16:25.000Z | 2022-03-29T13:16:25.000Z | lib/generateCode/example1/rtos/sdfchannel/sdfchanel.c | Rojods/CInTSyDe | b026d7e59b7707b0d43032a74a085875b43dd281 | [
"MIT"
] | null | null | null | lib/generateCode/example1/rtos/sdfchannel/sdfchanel.c | Rojods/CInTSyDe | b026d7e59b7707b0d43032a74a085875b43dd281 | [
"MIT"
] | null | null | null | #include "FreeRTOS.h"
#include "semphr.h"
#include "timers.h"
#include "queue.h"
#include "../datatype/datatype_definition.h"
/*
============================================
SDFChannel GrayScaleToAbs Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_GrayScaleToAbs;
/* maximum number of tokens in message queue */
int queue_length_GrayScaleToAbs = 2;
/* size of token */
long item_size_GrayScaleToAbs = sizeof(UInt16);
/*
============================================
SDFChannel AbsY Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_AbsY;
/* maximum number of tokens in message queue */
int queue_length_AbsY = 1;
/* size of token */
long item_size_AbsY = sizeof(UInt16);
/*
============================================
SDFChannel gysig Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_gysig;
/* maximum number of tokens in message queue */
int queue_length_gysig = 6;
/* size of token */
long item_size_gysig = sizeof(DoubleType);
/*
============================================
SDFChannel AbsX Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_AbsX;
/* maximum number of tokens in message queue */
int queue_length_AbsX = 1;
/* size of token */
long item_size_AbsX = sizeof(UInt16);
/*
============================================
SDFChannel GrayScaleToGetPx Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_GrayScaleToGetPx;
/* maximum number of tokens in message queue */
int queue_length_GrayScaleToGetPx = 6;
/* size of token */
long item_size_GrayScaleToGetPx = sizeof(DoubleType);
/*
============================================
SDFChannel gxsig Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_gxsig;
/* maximum number of tokens in message queue */
int queue_length_gxsig = 6;
/* size of token */
long item_size_gxsig = sizeof(DoubleType);
/*
============================================
SDFChannel absysig Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_absysig;
/* maximum number of tokens in message queue */
int queue_length_absysig = 1;
/* size of token */
long item_size_absysig = sizeof(DoubleType);
/*
============================================
SDFChannel absxsig Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_absxsig;
/* maximum number of tokens in message queue */
int queue_length_absxsig = 1;
/* size of token */
long item_size_absxsig = sizeof(DoubleType);
/*
============================================
SDFChannel GrayScaleX Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_GrayScaleX;
/* maximum number of tokens in message queue */
int queue_length_GrayScaleX = 1;
/* size of token */
long item_size_GrayScaleX = sizeof(UInt16);
/*
============================================
SDFChannel GrayScaleY Message Queue
============================================
*/
/* msg queue */
QueueHandle_t msg_queue_GrayScaleY;
/* maximum number of tokens in message queue */
int queue_length_GrayScaleY = 1;
/* size of token */
long item_size_GrayScaleY = sizeof(UInt16);
| 26.382813 | 53 | 0.550785 |
3bc3cb64de9eb2439fb62dccc1f9e90b3935a6df | 1,180 | h | C | iOSOpenDev/frameworks/CoreDAV.framework/Headers/CoreDAVGetTask.h | bzxy/cydia | f8c838cdbd86e49dddf15792e7aa56e2af80548d | [
"MIT"
] | 678 | 2017-11-17T08:33:19.000Z | 2022-03-26T10:40:20.000Z | iOSOpenDev/frameworks/CoreDAV.framework/Headers/CoreDAVGetTask.h | chenfanfang/Cydia | 5efce785bfd5f1064b9c0f0e29a9cc05aa24cad0 | [
"MIT"
] | 22 | 2019-04-16T05:51:53.000Z | 2021-11-08T06:18:45.000Z | iOSOpenDev/frameworks/CoreDAV.framework/Headers/CoreDAVGetTask.h | chenfanfang/Cydia | 5efce785bfd5f1064b9c0f0e29a9cc05aa24cad0 | [
"MIT"
] | 170 | 2018-06-10T07:59:20.000Z | 2022-03-22T16:19:33.000Z | /**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/CoreDAV.framework/CoreDAV
*/
#import <CoreDAV/CoreDAVTask.h>
@protocol CoreDAVTaskDelegate;
@interface CoreDAVGetTask : CoreDAVTask {
id _appSpecificDataItemResult; // 120 = 0x78
BOOL _forceNoCache; // 124 = 0x7c
}
@property(assign) BOOL forceNoCache; // G=0x25c75; S=0x25c85; @synthesize=_forceNoCache
@property(retain) id appSpecificDataItemResult; // G=0x25c3d; S=0x25c51; @synthesize=_appSpecificDataItemResult
@property(assign, nonatomic) id<CoreDAVTaskDelegate> delegate; // @dynamic
// declared property setter: - (void)setForceNoCache:(BOOL)cache; // 0x25c85
// declared property getter: - (BOOL)forceNoCache; // 0x25c75
// declared property setter: - (void)setAppSpecificDataItemResult:(id)result; // 0x25c51
// declared property getter: - (id)appSpecificDataItemResult; // 0x25c3d
- (void)finishCoreDAVTaskWithError:(id)error; // 0x25ac1
- (id)copyDefaultParserForContentType:(id)contentType; // 0x25a8d
- (id)requestBody; // 0x25a89
- (unsigned)cachePolicy; // 0x25a65
- (id)httpMethod; // 0x25a59
- (id)description; // 0x2590d
- (void)dealloc; // 0x258c1
@end
| 39.333333 | 111 | 0.755085 |
2885647d1860ab78c8db537b830c16f0f52f1d8f | 5,035 | rb | Ruby | spec/ebay_trading/sax_handler_spec.rb | leralle/ebay_trader | 3d4525ba577691cb40118a131fc0408c61caf118 | [
"MIT"
] | 5 | 2015-09-08T13:42:58.000Z | 2017-05-13T03:28:15.000Z | spec/ebay_trading/sax_handler_spec.rb | leralle/ebay_trader | 3d4525ba577691cb40118a131fc0408c61caf118 | [
"MIT"
] | 1 | 2016-07-29T12:25:34.000Z | 2016-07-29T12:25:34.000Z | spec/ebay_trading/sax_handler_spec.rb | leralle/ebay_trader | 3d4525ba577691cb40118a131fc0408c61caf118 | [
"MIT"
] | 7 | 2016-05-16T16:21:41.000Z | 2019-01-01T17:06:30.000Z | # frozen_string_literal: true
require 'json'
require 'ox'
require 'ebay_trader/sax_handler'
include EbayTrader
describe SaxHandler do
let(:xml) do
<<-XML
<?xml version="1.0" encoding="UTF-8"?>
<GetItemResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Item>
<StartPrice currencyID="USD">24.99</StartPrice>
<Percent>30.0</Percent>
<PictureDetails>
<GalleryType>Gallery</GalleryType>
<GalleryURL>http://i.ebayimg.com/00/s/MTI4MFgxMjgw/z/JqwAAOSwajVUODlI/$_1.JPG?set_id=880000500F</GalleryURL>
<PhotoDisplay>PicturePack</PhotoDisplay>
<PictureURL>http://i.ebayimg.com/00/s/MTI4MFgxMjgw/z/JqwAAOSwajVUODlI/$_1.JPG?set_id=880000500F</PictureURL>
<PictureURL>http://i.ebayimg.com/00/s/MTI4MFgxMjgw/z/ibIAAOSw8cNUODlL/$_1.JPG?set_id=880000500F</PictureURL>
<PictureURL>http://i.ebayimg.com/00/s/MTI4MFgxMjgw/z/cjsAAOSwY45UODlP/$_1.JPG?set_id=880000500F</PictureURL>
</PictureDetails>
</Item>
</GetItemResponse>
XML
end
describe 'HashWithIndifferentAccess.deep_find' do
subject(:hash) do
handler = SaxHandler.new
Ox.sax_parse(handler, StringIO.new(xml), convert_special: true)
handler.to_hash
end
it { is_expected.not_to be_nil }
it { is_expected.to be_a(Hash) }
it { is_expected.to be_a(HashWithIndifferentAccess) }
it { is_expected.to respond_to :deep_find }
it { puts JSON.pretty_generate hash }
it 'Should find a deeply nested element using deep_find' do
picture_details = hash.deep_find([:get_item_response, :item, :picture_details])
expect(picture_details).not_to be_nil
expect(picture_details).to be_a HashWithIndifferentAccess
[:gallery_type, :gallery_url, :photo_display, :picture_url].each do |key|
expect(picture_details).to have_key(key)
end
picture_url = picture_details.deep_find(:picture_url)
expect(picture_url).not_to be_nil
expect(picture_url).to be_a Array
expect(picture_url.count).to eq(3)
end
it 'should return the default value if path is not found' do
default = 'DEFAULT'.freeze
element = hash.deep_find([:get_item_response, :element_does_not_exist], default)
expect(element).not_to be_nil
expect(element).to eq(default)
end
end
describe 'Price types' do
let(:start_price) { hash.deep_find([:get_item_response, :item, :start_price]) }
let(:start_price_currency) { hash.deep_find([:get_item_response, :item, :start_price_currency]) }
let(:percent) { hash.deep_find([:get_item_response, :item, :percent]) }
context 'Default - BigDecimal' do
before { EbayTrader.configuration.price_type = nil } # Defaults to BigDecimal
subject(:hash) do
handler = SaxHandler.new
Ox.sax_parse(handler, StringIO.new(xml), convert_special: true)
handler.to_hash
end
it { expect(EbayTrader.configuration.price_type).to eq(:big_decimal) }
it { expect(start_price).to be_a(BigDecimal) }
it { expect(start_price).to eq(BigDecimal.new('24.99')) }
it { expect(start_price_currency).not_to be_nil }
it { expect(start_price_currency).to eq('USD') }
it { expect(percent).to be_a(Float) }
end
context 'Float' do
before { EbayTrader.configuration.price_type = :float }
subject(:hash) do
handler = SaxHandler.new
Ox.sax_parse(handler, StringIO.new(xml), convert_special: true)
handler.to_hash
end
it { expect(EbayTrader.configuration.price_type).to eq(:float) }
it { expect(start_price).to be_a(Float) }
it { expect(start_price).to eq(24.99) }
it { expect(start_price_currency).not_to be_nil }
it { expect(start_price_currency).to eq('USD') }
it { expect(percent).to be_a(Float) }
end
context 'Fixnum' do
before { EbayTrader.configuration.price_type = :fixnum }
subject(:hash) do
handler = SaxHandler.new
Ox.sax_parse(handler, StringIO.new(xml), convert_special: true)
handler.to_hash
end
it { expect(EbayTrader.configuration.price_type).to eq(:fixnum) }
it { expect(start_price).to be_a(Fixnum) }
it { expect(start_price).to eq(2499) }
it { expect(start_price_currency).not_to be_nil }
it { expect(start_price_currency).to eq('USD') }
it { expect(percent).to be_a(Float) }
end
end
context 'When there is an array mixed in a list of nodes' do
subject(:handler) do
handler = SaxHandler.new
Ox.sax_parse(handler, StringIO.new(xml), convert_special: true)
handler
end
it { expect(handler).not_to be_nil }
it { expect(handler.to_hash).not_to be_nil }
it { puts JSON.pretty_generate handler.to_hash }
let(:picture_url) { handler.to_hash[:get_item_response][:item][:picture_details][:picture_url] }
it 'Has an array of 3 photo URLs' do
expect(picture_url).not_to be_nil
expect(picture_url).to be_a(Array)
expect(picture_url.length).to eq(3)
end
end
end
| 31.666667 | 114 | 0.684806 |
21d0b61e84de4e23c2debdb89034463860031839 | 29,335 | html | HTML | test/data/VoterRegUrls/VR__ Vermont Election Division __.html | votedotorg/votedotorg-state-site-tracking | 850e41f0431c02858e085db5fe0b3acc32263163 | [
"MIT"
] | 3 | 2020-09-16T21:46:22.000Z | 2020-09-17T11:42:54.000Z | test/data/VoterRegUrls/VR__ Vermont Election Division __.html | votedotorg/votedotorg-state-site-tracking | 850e41f0431c02858e085db5fe0b3acc32263163 | [
"MIT"
] | 5 | 2020-09-26T01:18:19.000Z | 2020-10-08T17:21:16.000Z | test/data/VoterRegUrls/VR__ Vermont Election Division __.html | votedotorg/votedotorg-state-site-tracking | 850e41f0431c02858e085db5fe0b3acc32263163 | [
"MIT"
] | 1 | 2020-09-16T22:42:23.000Z | 2020-09-16T22:42:23.000Z | <!DOCTYPE html>
<!-- saved from url=(0025)https://olvr.vermont.gov/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>:: Vermont Election Division ::</title>
<link href="https://olvr.vermont.gov/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="./VR__ Vermont Election Division ___files/dialog_box.css" rel="stylesheet">
<script async="" src="./VR__ Vermont Election Division ___files/analytics.js"></script><script src="./VR__ Vermont Election Division ___files/modernizr"></script>
<script src="./VR__ Vermont Election Division ___files/jquery"></script>
<script src="./VR__ Vermont Election Division ___files/jqueryval"></script>
<script src="./VR__ Vermont Election Division ___files/common"></script>
<link href="./VR__ Vermont Election Division ___files/css" rel="stylesheet">
<script src="./VR__ Vermont Election Division ___files/jQueryFiles"></script>
<script src="./VR__ Vermont Election Division ___files/dialog_box.js"></script>
<script language="javascript" type="text/javascript" src="./VR__ Vermont Election Division ___files/Messages"></script>
<script type="text/javascript" language="javascript">
/* Start Google Analytic Code */
var GoogleCode = 'UA-27410400-11';
if (GoogleCode != '' && GoogleCode != null) {
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', GoogleCode, 'auto');
ga('send', 'pageview');
}
/* End Google Analytic Code */
// Ajax before send
/* To Set the Header for all ajax calls to send the key */
$(function () {
$.ajaxSetup({
headers: {
'__RequestVerificationToken': $('[name=__RequestVerificationToken]').val()
}
});
});
</script>
</head>
<body>
<input name="__RequestVerificationToken" type="hidden" value="uXGbjhvJFSz_mdQU8bbkORfVK5QpaMrTNBdEWY71CJJFp07p7cQTk8F_OsyPdD2ucIXNO8E8x6-7Azp92DSzSRsIOwho6-_5r0QE_nUA8aI1">
<div class="container">
<div class="mob_header hide">
<div class="left">
<img src="./VR__ Vermont Election Division ___files/header_mob_left.png" alt="">
</div>
<div class="right">
<img src="./VR__ Vermont Election Division ___files/header_mob_right.png" alt="" height="67" width="185">
</div>
</div>
<header class="header">
<div class="logo">
<img src="./VR__ Vermont Election Division ___files/ImageGen.ashx.png" alt="VermontSecretaryofState">
<br>
<br>
<div class="header_text">Online Voter Registration System</div>
<div class="header_mobile_text">
Online Voter Registration System
</div>
</div>
<div class="header_right">
<br>
<br>
<br>
<br>
<div class="secretaryJob">Vermont Secretary of State</div>
<div class="clr"></div>
<div class="secretaryName">Jim Condos</div>
</div>
<p> </p>
<div class="clr"></div>
<div class="header_mobile_text2">
Online Voter Registration System
</div>
</header>
<!--end of header part -->
<!-- start of contentpane-->
<input type="hidden" id="hdnImageCurrent" name="hdnImageCurrent">
<script src="./VR__ Vermont Election Division ___files/jquery.maskedinput-1.4.1.js"></script>
<script src="./VR__ Vermont Election Division ___files/common.js"></script>
<script src="./VR__ Vermont Election Division ___files/generic.js"></script>
<script src="./VR__ Vermont Election Division ___files/basic.js"></script>
<script src="./VR__ Vermont Election Division ___files/jquery.simplemodal.1.4.4.min.js"></script>
<style>
/* Small red Button */
.button_small_red {
background: #B11F10;
border-radius: 8px;
padding: 3px 10px 3px 10px;
color: #fff;
font-size: 10px;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
border: 0px;
cursor: pointer;
text-transform: uppercase;
}
.button_small_red:link {
color: #fff;
text-decoration: none;
}
.button_small_red:hover {
background: #741F22;
border-radius: 8px;
padding: 3px 10px 3px 10px;
color: #fff;
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
border: 0px;
cursor: pointer;
}
#simplemodal-container .simplemodal-data {
overflow: auto;
}
.screentitlesub1 {
border-bottom: 0 solid #f1f0d6;
color: #7a2426;
font-weight: bold;
}
.VoterInfoBox {
background: #ffffea;
width: 100%;
height: auto;
min-height: 190px;
border: 2px solid #e1dfc6;
border-radius: 5px;
float: left;
}
.header_top {
margin-left: 1%;
font-weight: 600;
padding: 1%;
}
.required_field {
margin-left: 83%;
margin-bottom: -7%;
}
.txtborder {
background: none repeat scroll 0 0 #fff;
border: 1px solid #c7c6b1;
border-radius: 3px;
color: #666;
padding: 3px;
}
.button_small {
background: none repeat scroll 0 0 #a8a175;
border: 0 none;
border-radius: 8px;
color: #fff;
cursor: pointer;
font-family: Arial,Helvetica,sans-serif;
font-size: 14px;
font-weight: bold;
padding: 4px 12px;
text-transform: uppercase;
}
#simplemodal-overlay {
background-color: #6A8BBF;
cursor: default;
}
/*#backgroundPopup {
background: #6A8BB;
}*/
</style>
<div class="contentpane">
<div class="help" style="display: none;">
<table>
<tbody><tr>
<td>
<a href="https://olvr.vermont.gov/#"><img src="./VR__ Vermont Election Division ___files/iconhelp.png" title="Help" onclick="viewHelpPage()" alt="Help"></a>
</td>
</tr>
</tbody></table>
</div>
<table width="100%">
<tbody><tr id="errorsPlaceHolderRow" style="display: none; text-align: left;">
<td style="width: 100%; background: #fee2d4">
<ul id="errorsPlaceHolder"></ul>
</td>
</tr>
<tr id="errorsPlaceHolderSpaceRow" style="display:none;">
<td> </td>
</tr>
</tbody></table>
<div class="index">
<table id="tblValidate" style="display:none">
<tbody><tr>
<td>
<input id="hdnValidate" rule="{$app.message.ValidateSource,'required'}">
</td>
</tr>
</tbody></table>
<div>
<p style="width: initial ; background: #fee2d4" id="errorsPlaceHolder1">
There is no deadline to register, you may register to vote up to and including the day of the election. However,<strong>if you register online the day before the election or on Election Day, your application may not be processed and your name may not appear on the checklist </strong> and you may be asked to fill out another application at the polls. To be sure your name appears on the checklist, <strong>please register by the Friday before the election.</strong>
</p>
<br>
</div>
<h2>Get Started:</h2>
<div>
<ol>
<li>1. Fill in all of the required fields on this application.</li>
<li>2. You are not registered to vote until your application is approved by the Town Clerk.</li>
<li>
3. You should receive an acknowledgment within two to four weeks after submitting or mailing your registration. Please contact
your Town Clerk if you have not received any information within this time.
</li>
<li>
4. If you are registering to vote in Vermont for the first time, you must include a photocopy of an acceptable form of ID. Acceptable forms of ID are:<br>
<span style="margin-left: 14px; font-size: 16px;">●</span> Valid photo ID (driver’s license or passport)<br>
<span style="margin-left: 14px; font-size: 16px;">●</span> Current utility bill<br>
<span style="margin-left: 14px; font-size: 16px;">●</span> Current bank statement<br>
<span style="margin-left: 14px; font-size: 16px;">●</span> Another government document containing your residential address.
</li>
</ol>
</div>
<div class="clr"></div>
<br>
<div class="lt_or">
<input type="button" class="button_home" title="Check Status" value="Check Status" onclick="CheckVoterInfoPopup()" name="input">
</div>
<div class="clr"></div>
<br>
<div>
<div class="lt_or">
<input type="button" class="button_home" onclick="SaveTempData(true);" value="I HAVE A VALID VT DRIVER'S LICENSE/PERMIT/ID #" name="btnRegister">
</div>
<div class="lt_or"><img src="./VR__ Vermont Election Division ___files/or.gif" alt="or"></div>
<div class="lt_or">
<input type="button" class="button_home" onclick="SaveTempData(false);" value="I DO NOT HAVE A VALID VT DRIVER'S LICENSE/PERMIT/ID #" name="btnRegister">
</div>
</div>
<br>
<br>
<div>
<strong>You may use this system to:</strong>
<br>
(1) register to vote in Vermont, (2) change your name and/or address on your current voter registration record.
</div>
</div>
<div class="clr"></div>
<p class="pd10 bg_light">
<strong>WARNING:</strong> A person who makes false statements on this application shall be subject to federal or state criminal penalties of up to a $10,000 fine, or imprisonment for not more than 15 years, or both. (17 V.S.A. § 2145(f); 17 V.S.A. § 2011; 42 U.S.C. § 1973gg-10).
</p>
</div>
<div id="backgroundPopup" style="opacity: 0.7; display: none;"></div>
<div id="divPopupVoterInfo" style="display: none;" class="boxbg">
<form id="frmPopupForm" name="frmPopupForm" method="post" class="">
<input name="__RequestVerificationToken" type="hidden" value="rVdQbGFcvWqOxioIBYwfrgYDG2PTPSvZ4MXC3tDf646AmoX1EZsdySxaEk857sY-lj6qmqsEU5Y7xheQS4u1g6aVShiqqwX5xm_VWkcbZZc1">
<div>
<table width="100%">
<tbody><tr>
<td align="left" width="50%">
<span class="screentitlesub1"> <label id="lblheading">CHECK REGISTRATION STATUS</label></span>
</td>
<td align="right" width="50%">
<label class="button_small_red" title="Close" onclick="WindowClose();">Close</label>
</td>
</tr>
</tbody></table>
</div>
<div class="VoterInfoBox">
<table width="100%" class="popupbg clsSearch" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<table id="tabValidate1" style="display:none" width="97%">
<tbody><tr id="errorsPlaceHolderSpaceRow1">
<td> </td>
</tr>
<tr id="errorsPlaceHolderRow1" style="text-align: left;">
<td style="width: 100%; background: #fee2d4">
<ul id="errorsPlaceHolder1"></ul>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td>
<p class="header_top"> Enter the below information to check you are already registered to vote with the state of Vermont.</p>
<p class="required_field"><span class="red">*</span>= required field</p>
</td>
</tr>
<tr>
<td align="left" valign="middle">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tbody>
<tr>
<td align="right" colspan="4"></td>
</tr>
<tr>
<td align="right"><span class="red">*</span>First Name:</td>
<td>
<input name="txtPopupFirstName" class="txtborder" id="txtPopupFirstName" type="text" maxlength="20" rule="{$app.message.ValidatePopFirstName,'required'}" autofocus="autofocus">
</td>
</tr>
<tr>
<td width="20%" align="right"><span class="red">*</span>Last Name:</td>
<td width="27%">
<input name="txtPopupLastName" class="txtborder" id="txtPopupLastName" type="text" maxlength="20" rule="{$app.message.ValidatePopLastName,'required'}">
</td>
</tr>
<tr>
<td align="right"><span class="red">*</span>Date of Birth:</td>
<td>
<input type="text" class="txtborde" name="txtPopDOB" id="txtPopDOB" placeholder="__/__/____" onkeypress="return isNumberKey(event, this);" onkeyup="return isNumberKey(event, this);" rule=" {$app.message.ValidatePopDOB,'required'}" maxlength="10" size="10">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0" class="popupbg clsSearch">
<tbody>
<tr>
<td align="center">
<input title="Check Status" class="button" onclick="GetVoterInfo();" type="button" value="Check Status">
</td>
</tr>
<tr>
<td align="left">
<input type="button" class="button_small" onclick="clearpopupdata();" title="Clear" value="Clear" style="margin-bottom: 1%;">
</td>
</tr>
</tbody>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0" class="popupbg clsResult" align="center" style="margin-top:-3%;">
<tbody>
<tr>
<td valign="top" align="left" class="header_top">
First Name: <label id="lblFname"></label>
</td>
<td valign="top" align="center" class="header_top">
Last Name: <label id="lblLname"></label>
</td>
<td valign="top" align="right" class="header_top">
Date of Birth: <label id="lblDOB"></label>
</td>
</tr>
<tr>
<td align="center" colspan="3" width="90%">
<div id="divVoterInfo" style="min-height:180px;max-height:210px;overflow:auto; width:90%;">
</div>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="popupbg clsResult" style="padding: 0px 0px 10px 20px;">
<tbody>
<tr>
<td align="left">
<input type="button" class="button_small" onclick="BacktoSearch();" title="Back" value="Back" style="margin-top: 0%;">
</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
<script type="text/javascript">
$(function () {
if ('' == "0") {
$("[name=btnRegister]").removeClass("button_home");
$("[name=btnRegister]").addClass("button_disable");
$("[name=btnRegister]").attr("disabled", true);
$ec.validate("tblValidate");
}
});
function SaveTempData(haveDL) {
$.ajax({
type: 'post',
data: { Source: '', HaveDL: haveDL },
beforeSend: function (request) {
request.setRequestHeader("__RequestVerificationToken", ($('[name=__RequestVerificationToken]') != null ? $('[name=__RequestVerificationToken]').val() : ''));
},
headers: {
'__RequestVerificationToken': $('[name=__RequestVerificationToken]').val()
},
url: "/Registration/SavetheRequest",
success: function (data) {
window.location = '/Registration/RegistrationDetails';
}
});
}
/* Check Voter Info Popup Pop-Up */
function CheckVoterInfoPopup() {
// if ($.mask) {
// $("#txtPopDOB").mask("99/99");
// $("#txtPopDOB").mask("99/99/9999");
// $("#txtPopDOB").attr("placeholder", "__/__/____");
// }
$('#divPopupVoterInfo').show();
$("#divPopupVoterInfo").modal();
$("#simplemodal-container").css({ 'min-height': '70%','position': 'fixed', 'z-index': '1002' });
$('#simplemodal-container').draggable();
$('.clsSearch').show();
$('.clsResult').hide();
$('#txtPopupFirstName').focus();
$('#backgroundPopup').show();
$('#backgroundPopup').hide();
}
// clear pop up data
function clearpopupdata() {
$("#txtPopupLastName").val("");
$("#txtPopupFirstName").val("");
$("#txtPopDOB").val("");
$ec.obj('errorsPlaceHolderRow').style.display = "none";
$('img.errorIndicator').hide();
}
function isNumberKey(evt, ctrlName) {
var str = ctrlName.value;
var charCode = (evt.which) ? evt.which : evt.keyCode
if (charCode < 58 && charCode > 47) {
if (str.match(/^\d{2}$/) !== null) {
ctrlName.value = str + '/';
}
else if (str.match(/^\d{2}\/\d{2}$/) !== null) {
ctrlName.value = str + '/';
}
return true;
}
else {
return false;
}
}
// Pop up DOB validation
function ValidatePopDOB() {
var dateFormat = "mm/dd/yyyy";
if (trim($ec.obj("txtPopDOB").value) == '') {
return $app.message.ValidatePopReqDOB;
}
else if (!$ec.isDate(trim($ec.obj("txtPopDOB").value), dateFormat)) {
return $ec.messagebox($app.message.ValidatePopDOB);
}
else if (new Date() < new Date(trim($ec.obj("txtPopDOB").value))) {
return $ec.messagebox($app.message.ValidDateNotFuture);
}
else if (new Date(trim($ec.obj("txtPopDOB").value)).getFullYear() < 1900) {
return $ec.messagebox($app.message.ValidDOB);
}
else {
return '';
}
}
/* close - popup code */
function WindowClose() {
$.modal.close();
$('#divPopupVoterInfo').hide();
$ec.obj('errorsPlaceHolderRow').style.display = "none";
$('#backgroundPopup').hide();
}
// Get popup Voter Information
function GetVoterInfo() {
if (ValidateFormSubmit("frmPopupForm")) {
if (ValidatePopDOB() == '') {
$.ajax({
type: 'post',
data: $("#frmPopupForm").serialize(),
beforeSend: function (request) {
request.setRequestHeader("__RequestVerificationToken", ($('[name=__RequestVerificationToken]') != null ? $('[name=__RequestVerificationToken]').val() : ''));
},
headers: {
'__RequestVerificationToken': $('[name=__RequestVerificationToken]').val()
},
async: false,
url: '/Registration/GetVoterCheckInfo',
success: function (result) {
$("#divVoterInfo").html(result);
if ($ec.obj('VoterInfoListGrid').innerHTML.indexOf('No records to view.') > -1) {
$("#VoterInfoListGrid > tbody").empty();
$("#VoterInfoListGrid > tbody").append("<tr><td class='gridEmptyData' colspan='13'>No registration found.<br/> <span class='checktstatusError'> If you believe you are already registered to vote, contact your town clerk to update your information. If you are not registered, please <br><a href='''> click here</a> to register online.</span></td></tr>")
}
else {
$("#VoterInfoListGrid > tbody").append("<tr><td class='gridEmptyData' colspan='11'><span class='checktstatusError'>Records show you are currently registered to vote in this town. If your address has changed within this town, log into the <a href='https://mvp.sec.state.vt.us''>My Voter Page </a>to update your record. If you no longer live in this town, please complete the online registration process. If your name appears in more than one town. Please email sos.elections@vermont.gov to have your name removed in one of the towns.</span></td></tr>")
}
$('.clsSearch').hide();
$('.clsResult').show();
//$("#lblheading").text(VOTER_INFORMATION);
$("#lblFname").text($("#txtPopupFirstName").val());
$("#lblLname").text($("#txtPopupLastName").val());
$("#lblDOB").text($("#txtPopDOB").val());
}
});
}
else {
$ec.obj('errorsPlaceHolderRow').style.display = "none";
return false;
}
}
$ec.obj('errorsPlaceHolderRow').style.display = "none";
}
/* Back to search*/
function BacktoSearch() {
$('.clsSearch').show();
$('.clsResult').hide();
}
</script>
<!--end of contentpane -->
<!--end of bottom links -->
<div class="clr"></div>
<!-- end of container -->
</div>
<footer id="globalfooterhome" class="globalFooter_home" role="contentinfo" style="display: none;">
<div class="globalFooterInner">
<div class="container_footer">
© 2020 Copyright 128 State Street, Montpelier, Vermont 05633 Phone: 802-828-2363 Fax: 802-828-5171
<a href="https://sos.vermont.gov/" target="_blank">sos.vermont.gov</a>
Version 1.9
</div>
<script src="./VR__ Vermont Election Division ___files/require.js" type="text/javascript"></script>
</div>
</footer>
<footer id="globalfooterlogin" class="globalFooter" role="contentinfo" style="display: block;">
<div class="globalFooterInner">
© 2020 Copyright 128 State Street, Montpelier, Vermont 05633 Phone: 802-828-2363 Fax: 802-828-5171
<a href="https://sos.vermont.gov/" target="_blank">sos.vermont.gov</a>
Version 1.9
</div>
<script src="./VR__ Vermont Election Division ___files/require.js" type="text/javascript"></script>
</footer>
<script async="" type="text/javascript" src="./VR__ Vermont Election Division ___files/_Incapsula_Resource"></script>
<script type="text/javascript" language="javascript">
jQuery().ready(function () {
/* Make All Data As Upper Case */
$("input[type='text']").on('blur', function () {
this.value = this.value.toUpperCase();
});
$(".help").hide();
});
if ('' == "Y") {
document.getElementById("globalfooterlogin").style.display = "none";
document.getElementById("globalfooterhome").style.display = "block";
}
else {
document.getElementById("globalfooterlogin").style.display = "block";
document.getElementById("globalfooterhome").style.display = "none";
}
$(document).ajaxStart(function () {
var userTheme = 'Default';
jsMin.showDialog("<div id='div_loading' style='overflow:hidden;font-family:Arial, verdana;font-size:12px;width: 300px; height: 50px; background-color: #FFFFFF;color:black; font-weight: bold;border: solid 1px #cccccc; vertical-align: middle; text-align: center; font-size: 11px'><br /><img src='../Images/Load_Progress.gif' alt='' align='absmiddle' /><br /><label class='progessfont'>Please wait. Your request is being processed.</label></div>", 302, 50);
});
$(document).ajaxStop(function () {
jsMin.closeDialog();
});
function adjustDivs() {
var df = document.getElementById('__div_layer___fordialog');
if (df != null) {
df.style.position = 'fixed';
df.style.valign = 'middle';
df.style.align = 'center';
}
}
//Disable the Back space key
$(document).keydown(function (e) {
var nodeName = e.target.nodeName.toLowerCase();
if (e.which === 8) {
if ((nodeName === 'input' && e.target.type === 'text') ||
nodeName === 'textarea') {
// do nothing
} else {
e.preventDefault();
}
}
});
//Open help screen.
function viewHelpPage(bId) {
if (bId == undefined)
bId = ''
else
bId = "#" + bId;
$.ajax({
type: 'POST',
url: '/System/SaveViewPageInfo',
data: {
title: window.document.title,
link: 'Registration' + "/" + 'Index' + bId,
request: ''
},
success: function (data) {
var newWin = window.open('/System/ViewPage', 'NewPage', 'menubar=0,width=820,height=500,resizable=1,Top=' + (window.screen.height / 2 - 250) + ',Left=' + (window.screen.width / 2 - 400) + ',scrollbars=1');
if (newWin == null)
$ec.messagebox("Please turn off the Pop-up Blocker");
}
});
}
//Open help screen.
function viewHelpPageContent(bId, link) {
if (bId == undefined)
bId = ''
else
bId = "_" + bId;
if (link == undefined) {
link = 'Registration/Index';
}
$.ajax({
type: 'POST',
url: '/System/SaveViewPageInfo',
data: {
title: window.document.title,
link: link,
request: ''
},
success: function (data) {
var newWin = window.open('/System/ViewPage', 'NewPage', 'menubar=0,width=820,height=500,resizable=1,Top=' + (window.screen.height / 2 - 250) + ',Left=' + (window.screen.width / 2 - 400) + ',scrollbars=1');
if (newWin == null)
// alert('Please turn off the Pop-up Blocker');
$ec.messagebox("Please turn off the Pop-up Blocker");
}
});
}
</script>
</body></html> | 41.609929 | 579 | 0.509664 |
2f68c1faa200a5f5b2cd9d9d79b63e7b430dbdb6 | 6,423 | php | PHP | resources/views/importar.blade.php | chrissierra/liquidaciondesueldo_cl | 1f503e907ab84a66312cfbcb7601140fa9aa6286 | [
"MIT"
] | null | null | null | resources/views/importar.blade.php | chrissierra/liquidaciondesueldo_cl | 1f503e907ab84a66312cfbcb7601140fa9aa6286 | [
"MIT"
] | 5 | 2021-03-10T04:12:52.000Z | 2022-02-26T22:18:54.000Z | resources/views/importar.blade.php | chrissierra/liquidaciondesueldo_cl | 1f503e907ab84a66312cfbcb7601140fa9aa6286 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-154973674-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-154973674-2');
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono|Roboto:400,700,900&display=swap" rel="stylesheet">
<title>Liquidacion de sueldo</title>
<link rel="stylesheet" href="{{ URL::asset('css/app.css') }}">
{!! SEO::generate() !!}
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
</head>
<style type="text/css">
.tabla_explicacion_masivo{
min-width: 100em;
}
</style>
<body>
@component('componentes.navbar')
@endcomponent
<div class="container mb-5">
<div class="card">
<div class="card-body">
<div class="row mb-5">
<div class="col-12 text-center">
<h2 class="titulo mb-4">
Calcular sueldo liquido
</h2>
</div>
<div class="col-12 mb-5">
<p class="text-muted subtitulo">
Debes poner mucha atención al usar nuestro servicio de liquidacion de sueldo masivo para calcular sueldo liquido.
</p>
</div>
<div class="col-12">
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th scope="col tabla_explicacion_masivo " style="min-width: 10em;">Nombre</th>
<th scope="col tabla_explicacion_masivo " style="min-width: 10em;">Apellido</th>
<th scope="col tabla_explicacion_masivo " style="min-width: 10em;">Liquido</th>
<th scope="col tabla_explicacion_masivo " style="min-width: 10em;">Movilizacion</th>
<th scope="col tabla_explicacion_masivo " style="min-width: 10em;">Colacion</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">AFP</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">Isapre</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">Fun</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">TipoContrato</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">Cargas</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">Tramo</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">Mes</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">Anio</th>
<th scope="col tabla_explicacion_masivo" style="min-width: 10em;">Gratificacion</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Los nombres del trabajador</th>
<td>Apellidos Del trabajador</td>
<td>Monto líquido a pagar (Pactado)</td>
<td>Monto a pagar por movilización</td>
<td>Monto a pagar por Colación</td>
<td>
<p>Debes rellenar solamente con el número. Ej, si es Modelo debes poner solamente un 6.</p>
<p>0-Provida</p>
<p>1-Capital</p>
<p>2-Cuprum</p>
<p>3-PlanVital</p>
<p>4-Uno</p>
<p>5-IPS</p>
<p>6-Modelo</p>
<p>7-Habitat</p>
<p>8-Pensionado</p>
</td><!-- 'Provida', 'Capital', 'Cuprum', 'PlanVital', 'Uno', 'IPS', 'Modelo', 'Habitat', 'Pensionado' -->
<td>Fonasa o isapre. </td>
<td>Monto en UF separado por puntos. Ej: 1.52</td>
<td>Si es indefinido se escribe 1; si es fijo se escribe 2.</td>
<td>Numero de cargas. Escribir un número entero. Ej: 2</td>
<td>Escribir un 1 si es tramo 1. 2 para el tramo 2 y 3 para el tramo 3. </td>
<td>Escribir con un número entero el mes. Ej: 3 ( Marzo )</td>
<td>Escribir con un número entero el Año. Ej: 2020</td>
<td>Escribir con un número entero la gratificación, si es 1 será mensual. Si se escribe 2 se cancelará anual.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<p>
Puedes descargar el CSV que utilizamos desde el siguiente link. Debes mantener las cabeceras y completarlo simplemente.
</p>
<p>
<a href="{{ asset('file/test_.csv') }}">Archivo CSV</a>
</p>
</div>
</div>
<div class="row ">
<form action="{{ route('importacion.csv') }}" method="post" enctype="multipart/form-data" >
@csrf
<input type="file" name="csv">
<button>Importar</button>
</form>
</div>
</div>
</div>
</div>
<!-- <form action="{{ route('importacion.csv') }}" method="post" enctype="multipart/form-data" >
@csrf
<input type="file" name="csv">
<button>Importar</button>
</form> -->
</body>
<script type="text/javascript" src="{{ URL::asset('js/app.js') }}"></script>
</html>
| 40.14375 | 192 | 0.476569 |
5de2a7461b06f77b16769190ca1ab06f8c16ba57 | 3,073 | h | C | resource/px_sparkfun.h | AcceleratingVector/SFAward | 97fc8f21400f327daf88602b1e51d9f96c01e88b | [
"MIT"
] | null | null | null | resource/px_sparkfun.h | AcceleratingVector/SFAward | 97fc8f21400f327daf88602b1e51d9f96c01e88b | [
"MIT"
] | null | null | null | resource/px_sparkfun.h | AcceleratingVector/SFAward | 97fc8f21400f327daf88602b1e51d9f96c01e88b | [
"MIT"
] | null | null | null | /*
* From the Sparkfun Library for this display.
*/
/** \brief MicroOLED screen buffer.
Page buffer 64 x 48 divided by 8 = 384 bytes
Page buffer is required because in SPI mode, the host cannot read the SSD1306's GDRAM of the controller. This page buffer serves as a scratch RAM for graphical functions. All drawing function will first be drawn on this page buffer, only upon calling display() function will transfer the page buffer to the actual LCD controller's memory.
*/
#define widthImgSparkFun 64
uint8_t imgSparkFun [] = {
//SparkFun Electronics LOGO
// ROW0, BYTE0 to BYTE63
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x0F, 0x07, 0x07, 0x06, 0x06, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ROW1, BYTE64 to BYTE127
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x07, 0x0F, 0x3F, 0x3F, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFC, 0xFC, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ROW2, BYTE128 to BYTE191
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC,
0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xF0, 0xFD, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ROW3, BYTE192 to BYTE255
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x07, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ROW4, BYTE256 to BYTE319
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x1F, 0x0F, 0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F, 0x0F, 0x07, 0x07, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ROW5, BYTE320 to BYTE383
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; | 60.254902 | 340 | 0.678815 |
74628061c18d74744c6dd92f395b5b81ea240cd2 | 5,228 | rs | Rust | src/http.rs | lebai-robotics/aiot-rust | b91d284256733c0bdf64483237d6a05826966d81 | [
"MIT"
] | 3 | 2021-08-16T08:03:56.000Z | 2021-12-31T02:56:10.000Z | src/http.rs | lebai-robotics/aiot-rust | b91d284256733c0bdf64483237d6a05826966d81 | [
"MIT"
] | null | null | null | src/http.rs | lebai-robotics/aiot-rust | b91d284256733c0bdf64483237d6a05826966d81 | [
"MIT"
] | 1 | 2022-02-19T14:22:32.000Z | 2022-02-19T14:22:32.000Z | //! HTTPS 接入。
use crate::util::auth;
use crate::ThreeTuple;
use log::*;
use reqwest::{Certificate, ClientBuilder};
use serde::{Deserialize, Serialize};
type Result<T> = core::result::Result<T, HttpError>;
#[derive(Debug)]
pub struct Http {
pub host: String,
pub three: ThreeTuple,
pub token: Option<String>,
client: reqwest::Client,
pub extend: Option<String>,
}
impl Http {
pub fn new_tls(host: &str, three: &ThreeTuple) -> crate::Result<Self> {
let cred = Certificate::from_pem(auth::ALI_CA_CERT.as_bytes())?;
let client = ClientBuilder::new()
.add_root_certificate(cred)
.http1_title_case_headers()
.build()?;
Ok(Self {
host: host.to_string(),
three: three.clone(),
token: None,
client,
extend: None,
})
}
fn extend_devinfo(&self) -> &str {
if let Some(s) = &self.extend {
s
} else {
""
}
}
pub async fn auth(&mut self) -> crate::Result<()> {
let url = format!(
"https://{}/auth?_v={}&{}",
self.host,
*crate::util::CORE_SDK_VERSION,
self.extend_devinfo()
);
let body = HttpAuthBody {
product_key: self.three.product_key.to_string(),
device_name: self.three.device_name.to_string(),
client_id: auth::http::client_id(&self.three.product_key, &self.three.device_name),
// timestamp: None,
sign: auth::http::password(
&self.three.product_key,
&self.three.device_name,
&self.three.device_secret,
),
signmethod: Some(auth::SIGN_METHOD.to_string()),
};
debug!("{}", serde_json::to_string(&body)?);
let res = self.client.post(&url).json(&body).send().await?;
debug!("{:?}", res);
let res: HttpResponse = res.json().await?;
debug!("{:?}", res);
// let res: InfoToken = res.try_into()?;
// debug!("{:?}", res);
self.token = Some(res.get(true, "token")?);
Ok(())
}
// 返回 messageId
pub async fn send(&mut self, topic: &str, data: &[u8]) -> crate::Result<String> {
let token = self.token.clone().ok_or(HttpError::TokenIsNull)?;
let url = format!("https://{}/topic{}", self.host, topic);
let res = self
.client
.post(url)
.header("Content-Type", "application/octet-stream")
.header("password", token)
.body(data.to_vec());
debug!("{:?}", res);
let res = res.send().await?;
debug!("{:?}", res);
let res: HttpResponse = res.json().await?;
debug!("{:?}", res);
Ok(res.get(false, "messageId")?)
}
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct HttpAuthBody {
#[serde(rename = "productKey")]
pub product_key: String,
#[serde(rename = "deviceName")]
pub device_name: String,
#[serde(rename = "clientId")]
pub client_id: String,
// pub timestamp: Option<String>,
pub sign: String,
pub signmethod: Option<String>,
// pub version: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct HttpResponse {
pub code: i32,
pub message: String,
pub info: Option<serde_json::Value>,
}
impl HttpResponse {
pub fn get(&self, is_auth: bool, key: &str) -> Result<String> {
use HttpError::*;
match self.code {
0 => match &self.info {
Some(data) => match data.get(key) {
Some(data) => match data.as_str() {
Some(data) => Ok(data.to_string()),
None => Err(ParseError),
},
None => Err(ParseError),
},
None => Err(ParseError),
},
10000 => Err(CommonError),
10001 => Err(ParamError),
20000 => Err(AuthCheckError),
20001 => Err(TokenIsExpired),
20002 => {
// https://help.aliyun.com/document_detail/58034.html
// 阿里云平台两个接口返回的错误码定义不一样
if is_auth {
Err(UpdateSessionError)
} else {
Err(TokenIsNull)
}
}
20003 => Err(CheckTokenError),
30001 => Err(PublishMessageError),
40000 => Err(RequestTooMany),
_ => Err(Unknown(self.code, self.message.clone())),
}
}
}
#[derive(thiserror::Error, Debug)]
pub enum HttpError {
#[error("未知错误")]
CommonError,
#[error("请求的参数异常")]
ParamError,
#[error("设备鉴权失败")]
AuthCheckError,
#[error("更新失败")]
UpdateSessionError,
#[error("解析失败")]
ParseError,
#[error("请求次数过多,流控限制")]
RequestTooMany,
#[error("token失效。需重新调用auth进行鉴权,获取token")]
TokenIsExpired,
#[error("请求header中无token信息")]
TokenIsNull,
#[error("根据token获取identify信息失败。需重新调用auth进行鉴权,获取token")]
CheckTokenError,
#[error("数据上行失败")]
PublishMessageError,
#[error("未知错误 {1} 错误码 {0}")]
Unknown(i32, String),
}
| 30.045977 | 95 | 0.525057 |
0ed43b3eafc4db7a921bb8829f9dc1403003dfb0 | 5,737 | h | C | external/unbound/iterator/iter_hints.h | sohanlaxmicoin/laxmi | 05f8500b000359f78dd19f90062d586f4e9beb4e | [
"BSD-3-Clause"
] | null | null | null | external/unbound/iterator/iter_hints.h | sohanlaxmicoin/laxmi | 05f8500b000359f78dd19f90062d586f4e9beb4e | [
"BSD-3-Clause"
] | 1 | 2018-08-21T01:16:19.000Z | 2018-08-21T01:16:19.000Z | external/unbound/iterator/iter_hints.h | sohanlaxmicoin/laxmi | 05f8500b000359f78dd19f90062d586f4e9beb4e | [
"BSD-3-Clause"
] | null | null | null | /*
* iterator/iter_hints.h - iterative resolver module stub and root hints.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of stub and root hints, and read those from config.
*/
#ifndef ITERATOR_ITER_HINTS_H
#define ITERATOR_ITER_HINTS_H
#include "util/storage/dnstree.h"
struct iter_env;
struct config_file;
struct delegpt;
/**
* Iterator hints structure
*/
struct iter_hints {
/**
* Hints are stored in this tree. Sort order is specially chosen.
* first sorted on qclass. Then on dname in nsec-like order, so that
* a lookup on class, name will return an exact match or the closest
* match which gives the ancestor needed.
* contents of type iter_hints_stub. The class IN root is in here.
* uses name_tree_node from dnstree.h.
*/
rbtree_type tree;
};
/**
* Iterator hints for a particular stub.
*/
struct iter_hints_stub {
/** tree sorted by name, class */
struct name_tree_node node;
/** delegation point with hint information for this stub. malloced. */
struct delegpt* dp;
/** does the stub need to forego priming (like on other ports) */
uint8_t noprime;
};
/**
* Create hints
* @return new hints or NULL on error.
*/
struct iter_hints* hints_create(void);
/**
* Delete hints.
* @param hints: to delete.
*/
void hints_delete(struct iter_hints* hints);
/**
* Process hints config. Sets default values for root hints if no config.
* @param hints: where to store.
* @param cfg: config options.
* @return 0 on error.
*/
int hints_apply_cfg(struct iter_hints* hints, struct config_file* cfg);
/**
* Find root hints for the given class.
* @param hints: hint storage.
* @param qclass: class for which root hints are requested. host order.
* @return: NULL if no hints, or a ptr to stored hints.
*/
struct delegpt* hints_lookup_root(struct iter_hints* hints, uint16_t qclass);
/**
* Find next root hints (to cycle through all root hints).
* @param hints: hint storage
* @param qclass: class for which root hints are sought.
* 0 means give the first available root hints class.
* x means, give class x or a higher class if any.
* returns the found class in this variable.
* @return true if a root hint class is found.
* false if not root hint class is found (qclass may have been changed).
*/
int hints_next_root(struct iter_hints* hints, uint16_t* qclass);
/**
* Given a qname/qclass combination, and the delegation point from the cache
* for this qname/qclass, determine if this combination indicates that a
* stub hint exists and must be primed.
*
* @param hints: hint storage.
* @param qname: The qname that generated the delegation point.
* @param qclass: The qclass that generated the delegation point.
* @param dp: The cache generated delegation point.
* @return: A priming delegation point if there is a stub hint that must
* be primed, otherwise null.
*/
struct iter_hints_stub* hints_lookup_stub(struct iter_hints* hints,
uint8_t* qname, uint16_t qclass, struct delegpt* dp);
/**
* Get memory in use by hints
* @param hints: hint storage.
* @return bytes in use
*/
size_t hints_get_mem(struct iter_hints* hints);
/**
* Add stub to hints structure. For external use since it recalcs
* the tree parents.
* @param hints: the hints data structure
* @param c: class of zone
* @param dp: delegation point with name and target nameservers for new
* hints stub. malloced.
* @param noprime: set noprime option to true or false on new hint stub.
* @return false on failure (out of memory);
*/
int hints_add_stub(struct iter_hints* hints, uint16_t c, struct delegpt* dp,
int noprime);
/**
* Remove stub from hints structure. For external use since it
* recalcs the tree parents.
* @param hints: the hints data structure
* @param c: class of stub zone
* @param nm: name of stub zone (in uncompressed wireformat).
*/
void hints_delete_stub(struct iter_hints* hints, uint16_t c, uint8_t* nm);
#endif /* ITERATOR_ITER_HINTS_H */
| 35.41358 | 78 | 0.715356 |
fd584b7a5cf577bc3cfbd457a2d10ca1c9e3cf5a | 1,815 | c | C | src/utils.c | tomasz-lisowski/functional-dependency-tool | 7cc87e1edaef2e8ee50fa461a4374e54ae66db8d | [
"MIT"
] | null | null | null | src/utils.c | tomasz-lisowski/functional-dependency-tool | 7cc87e1edaef2e8ee50fa461a4374e54ae66db8d | [
"MIT"
] | null | null | null | src/utils.c | tomasz-lisowski/functional-dependency-tool | 7cc87e1edaef2e8ee50fa461a4374e54ae66db8d | [
"MIT"
] | null | null | null | #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils.h"
bool subset_sorted(void *set_a, void *set_b, uint32_t set_a_len, uint32_t set_b_len, uint32_t el_size)
{
uint32_t set_a_idx = 0;
for (uint32_t set_b_idx = 0; set_b_idx < set_b_len; set_b_idx += 1)
{
if (memcmp(&((uint8_t *)set_b)[set_b_idx * el_size], &((uint8_t *)set_a)[set_a_idx * el_size], el_size) == 0)
{
set_a_idx += 1;
}
}
if (set_a_len == set_a_idx)
{
return true;
}
return false;
}
void sort(void *data, uint32_t el_count, uint32_t el_size, uint8_t (*comparator)(void *const, void *const))
{
// Insertion sort.
for (uint32_t i = 1; i < el_count; i++)
{
for (uint32_t j = i;
j > 0 &&
(comparator(&((uint8_t *)data)[j * el_size], &((uint8_t *)data)[(j - 1) * el_size]) ^ COMP_GREATER) == 0;
j--)
{
// Swapping [j] and [j-1]
uint8_t el_to_swap[el_size];
memcpy(&el_to_swap, &((uint8_t *)data)[j * el_size], el_size);
memcpy(&((uint8_t *)data)[j * el_size], &((uint8_t *)data)[(j - 1) * el_size], el_size);
memcpy(&((uint8_t *)data)[(j - 1) * el_size], &el_to_swap, el_size);
}
}
}
void flip(void *data, uint32_t el_count, uint32_t el_size)
{
uint32_t count_half = el_count % 2 == 0 ? el_count / 2 : (el_count - 1) / 2;
for (uint32_t data_idx = 0; data_idx < count_half; data_idx += 1)
{
uint8_t *el_a = &((uint8_t *)data)[data_idx * el_size];
uint8_t *el_b = &((uint8_t *)data)[(el_count - 1 - data_idx) * el_size];
uint8_t tmp[el_size];
memcpy(tmp, el_a, el_size);
memcpy(el_a, el_b, el_size);
memcpy(el_b, tmp, el_size);
}
}
| 31.842105 | 118 | 0.559229 |
20579dce8c370b7351fe642c332a111a82d743ff | 1,160 | css | CSS | web/assets/front/css/MalekCSS.css | MedBenHadid/reactorsbenevolat | dd06261e8ab090b84f897b813b8cc7882e9a8412 | [
"MIT"
] | 1 | 2021-05-30T15:08:19.000Z | 2021-05-30T15:08:19.000Z | web/assets/front/css/MalekCSS.css | MedBenHadid/reactorsbenevolat | dd06261e8ab090b84f897b813b8cc7882e9a8412 | [
"MIT"
] | null | null | null | web/assets/front/css/MalekCSS.css | MedBenHadid/reactorsbenevolat | dd06261e8ab090b84f897b813b8cc7882e9a8412 | [
"MIT"
] | null | null | null | :root {
--teal-color: grey;
--purple-color: #9E41CC;
}
body {
color: var(--teal-color);
}
ul {
padding: 0;
list-style: none;
}
.topics-table {
margin-top: 1rem;
padding: 8px;
border: 2px solid var(--teal-color);
border-radius: 10px;
}
.topics-table a {
/*color: var(--purple-color);*/
}
ul.header-titles, li.topics-body, li.topics-body ul {
overflow: hidden;
}
li.topics-header, ul[class^='topic-item-'] {
padding: 8px;
}
ul[class^='topic-item-'] {
border-top: 1px solid var(--teal-color);
}
.header-titles li, ul[class^='topic-item-'] li {
width: 25%;
float: left;
}
.badge {
font-weight: normal;
}
.agenda { }
/* Dates */
.agenda .agenda-date { width: 170px; }
.agenda .agenda-date .dayofmonth {
width: 40px;
font-size: 36px;
line-height: 36px;
float: left;
text-align: right;
margin-right: 10px;
}
.agenda .agenda-date .shortdate {
font-size: 0.75em;
}
div.c {
font-size: 300%;
}
/* Times */
.agenda .agenda-time { width: 140px; }
/* Events */
.agenda .agenda-events { }
.agenda .agenda-events .agenda-event { }
@media (max-width: 767px) {
} | 15.064935 | 53 | 0.589655 |
5c8a5aabd37f72121dd8848ac682c4dd0e297968 | 4,755 | c | C | src/io.c | MatthewZito/tabloid | bdfa4b13e558edb10d47044fbc1ac75c63f76119 | [
"MIT"
] | null | null | null | src/io.c | MatthewZito/tabloid | bdfa4b13e558edb10d47044fbc1ac75c63f76119 | [
"MIT"
] | null | null | null | src/io.c | MatthewZito/tabloid | bdfa4b13e558edb10d47044fbc1ac75c63f76119 | [
"MIT"
] | null | null | null | /**
* @file io.c
* @author goldmund
* @brief Handles file I/O to program
* @version 0.1
* @date 2021-07-05
*
* @copyright Copyright (c) 2021 Matthew Zito (goldmund)
*
*/
/* Feature Test Macros */
#define _DEFAULT_SOURCE // ea. handles `getline` resolution
#define _BSD_SOURCE
#define _GNU_SOURCE
#include "io.h"
#include "common.h"
#include "error.h"
#include "keypress.h"
#include "render.h"
#include "stream.h"
#include "syntax.h"
#include "viewport.h"
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
// `strdup` is not yet a part of Standard C
// it is standardized in POSIX.1-2008, and may or may not be provided by <string.h>
#ifndef STRDUP_H
#define STRDUP_H
char* strdup(const char* s) {
size_t size = strlen(s) + 1;
char* p = malloc(size);
if (p) {
// from what I can tell, `memcpy` here is more efficient than `strcpy`
memcpy(p, s, size);
}
return p;
}
#endif
/***********
*
* File I/O
*
***********/
/**
* @brief Open a file in the editor
*
* @param filename
*/
void f_open(char* filename) {
free(T.filename);
T.filename = strdup(filename);
resolve_syntax();
FILE* stream = fopen(filename, "r");
if (!stream) panic("fopen");
char* line = NULL;
size_t linecap = 0; /**< Tracks how much memory has been allocated */
ssize_t linelen;
// -1 at EOF
while ((linelen = getline(&line, &linecap, stream)) != -1) {
// we know ea. `t_row` represents a single line of text, thus there is
// no reason to store the newline, carriage return
while (linelen > 0 && (line[linelen - 1] == '\n' || line[linelen - 1] == '\r')) {
linelen--;
}
insert_row(T.numrows, line, linelen);
}
free(line);
fclose(stream);
// because we invoke `insert_row`, status will be set to 'dirty' by default
// mitigate w/ reset
T.dirty = 0;
}
/**
* @brief Convert the current editor contents into a string
*
* Prepare the current editor contents for writing to a file;
* aggregates the length of ea row of text as `buflen`.
* Copies ea row content to the end of the buffer, inserting newlines.
*
* Expects the caller to invoke `free`
*
* @param buflen
* @return char*
*/
char* buf_out(int* buflen) {
int totlen = 0;
int i;
// aggregate len as len of ea text row
for (i = 0; i < T.numrows; i++) {
totlen += T.row[i].size + 1;
}
*buflen = totlen;
char* buf = malloc(totlen);
char* p = buf;
// copy ea text row into buffer
for (i = 0; i < T.numrows; i++) {
memcpy(p, T.row[i].chars, T.row[i].size);
p += T.row[i].size;
// manual NL insertion because we aren't parsing these
*p = '\n';
p++;
}
return buf;
}
/**
* @brief Write editor contents to either an existing or newly created file
*
* @todo Write to a swapfile first
*/
void f_write(void) {
if (!T.filename) {
T.filename = prompt("Save as %s (ESC to cancel)", NULL);
if (!T.filename) {
set_stats_msg("Save cancelled");
return;
}
resolve_syntax();
}
int len;
char* buf = buf_out(&len);
int fd = open(T.filename, O_RDWR | O_CREAT, 0644);
if (fd != -1) {
// by manually truncating to the same len as the writable data,
// we render the overwrite safer in the case that `write` fails
// (as opposed to passing `O_TRUNC` to `open` directly, which clears all data prior to writing)
if (ftruncate(fd, len) != -1) {
if (write(fd, buf, len) == len) {
close(fd);
free(buf);
T.dirty = 0; // reset dirty state
set_stats_msg("%d bytes written to disk", len);
return;
}
}
close(fd);
}
free(buf);
set_stats_msg("Unable to save file; I/O error: %s", strerror(errno));
}
/**
* @brief Prompt for and collect user input
*
* Expects the caller to invoke `free`
*
* @param prompt
* @param cb optional callback
* @return char*
*/
char* prompt(const char* prompt, void (*cb)(char*, int)) {
size_t bufsize = 128;
// store user input
char* buf = malloc(bufsize);
size_t buflen = 0;
buf[0] = NULL_TERM;
while (1) {
set_stats_msg(prompt, buf);
clear_screen();
int c = readkey();
// allow backspace in prompt
if (c == DEL || c == CTRL_KEY('h') || c == BACKSPACE) {
if (buflen != 0) buf[--buflen] = NULL_TERM;
} else if (c == ESCAPE) { // user hits esc to cancel
set_stats_msg("");
if (cb) cb(buf, c);
free(buf);
return NULL;
} else if (c == '\r') {
if (buflen != 0) {
set_stats_msg("");
if (cb) cb(buf, c);
return buf;
}
} else if (!iscntrl(c) && c < 128) {
// if `buflen` reaches max cap, double `bufsize`
if (buflen == bufsize - 1) {
bufsize *= 2;
buf = realloc(buf, bufsize);
}
buf[buflen++] = c;
buf[buflen] = NULL_TERM;
}
if (cb) cb(buf, c);
}
}
| 20.49569 | 97 | 0.612618 |
ae718edc75ac8edf8a86ef807e91857005b9638f | 451 | asm | Assembly | libsrc/_DEVELOPMENT/arch/ts2068/display/z80/asm_tshc_pxy2saddr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/ts2068/display/z80/asm_tshc_pxy2saddr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/ts2068/display/z80/asm_tshc_pxy2saddr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; ===============================================================
; May 2017
; ===============================================================
;
; void *tshc_pxy2saddr(uchar x, uchar y)
;
; Screen address of byte containing pixel at coordinate x, y.
;
; ===============================================================
SECTION code_clib
SECTION code_arch
PUBLIC asm_tshc_pxy2saddr
EXTERN asm_zx_pxy2saddr
defc asm_tshc_pxy2saddr = asm_zx_pxy2saddr
| 23.736842 | 65 | 0.445676 |
4065251b7e6601cbdb4a826ad5325db34dee3b4c | 1,040 | py | Python | tests/ts4/contracts/service.py | tonred/tonclick | 942c1012a1112616da0887437a93912e3dd537b9 | [
"Apache-2.0"
] | null | null | null | tests/ts4/contracts/service.py | tonred/tonclick | 942c1012a1112616da0887437a93912e3dd537b9 | [
"Apache-2.0"
] | null | null | null | tests/ts4/contracts/service.py | tonred/tonclick | 942c1012a1112616da0887437a93912e3dd537b9 | [
"Apache-2.0"
] | 2 | 2021-10-17T14:08:16.000Z | 2022-01-12T10:55:33.000Z | from tonos_ts4 import ts4
class Service(ts4.BaseContract):
def __init__(self, address: ts4.Address):
super().__init__('Service', {}, nickname='Service', address=address)
def get_subscription_plans(self) -> list[ts4.Address]:
return self.call_getter('getSubscriptionPlans', {'_answer_id': 0})
def get_balances(self) -> dict:
return self.call_getter('getBalances', {'_answer_id': 0})
def get_one_balances(self, tip_root: ts4.Address) -> int:
return self.call_getter('getOneBalance', {
'_answer_id': 0,
'tip3Root': tip_root,
})
def build_subscription_payload(
self,
subscription_plan_nonce: int,
user: ts4.Address,
pubkey: int,
auto_renew: bool
) -> ts4.Cell:
return self.call_getter('buildSubscriptionPayload', {
'subscriptionPlanNonce': subscription_plan_nonce,
'user': user,
'pubkey': pubkey,
'autoRenew': auto_renew,
})
| 30.588235 | 76 | 0.602885 |
2009ecb93d989b902816c7f2f92491c49a4dc15a | 2,419 | css | CSS | wp-content/plugins/all-in-one-seo-pack/dist/Lite/assets/css/tools-partials-BackupSettings-vue.rtl.css | david-berruezo/wp-rentals-theme-modified | 4e81adc68b1c6e3f11c1006c3573a106dca29790 | [
"Apache-2.0"
] | null | null | null | wp-content/plugins/all-in-one-seo-pack/dist/Lite/assets/css/tools-partials-BackupSettings-vue.rtl.css | david-berruezo/wp-rentals-theme-modified | 4e81adc68b1c6e3f11c1006c3573a106dca29790 | [
"Apache-2.0"
] | 21 | 2021-05-13T13:10:04.000Z | 2022-03-14T13:13:29.000Z | wp-content/plugins/all-in-one-seo-pack/dist/Lite/assets/css/tools-partials-BackupSettings-vue.rtl.css | david-berruezo/wp-rentals-theme-modified | 4e81adc68b1c6e3f11c1006c3573a106dca29790 | [
"Apache-2.0"
] | null | null | null | .aioseo-backup-settings .aioseo-alert{margin-bottom:20px}.aioseo-backup-settings .backups-table{border:1px solid #d0d1d7;border-radius:3px;margin-bottom:20px;font-size:16px}.aioseo-backup-settings .backups-table .backup-actions{max-width:50px}.aioseo-backup-settings .backups-table .backup-actions .aioseo-tooltip{display:inline-block;margin:0}.aioseo-backup-settings .backups-table .backups-rows{font-size:14px}.aioseo-backup-settings .backups-table .backups-rows .backup-row{background-color:#fff;height:70px;display:flex;align-items:center;padding:0 30px}.aioseo-backup-settings .backups-table .backups-rows .backup-row:last-of-type{border-radius:0 0 3px 3px}.aioseo-backup-settings .backups-table .backups-rows .backup-row.even{background-color:#f9f9fa}.aioseo-backup-settings .backups-table .backups-rows .backup-row>div{flex:1 0 auto;padding-left:30px}.aioseo-backup-settings .backups-table .backups-rows .backup-row>div:last-child{padding-left:0}.aioseo-backup-settings .backups-table .backups-rows .backup-row .backup-actions svg{width:20px;height:20px;color:#8c8f9a;cursor:pointer;transition:color .1s ease}.aioseo-backup-settings .backups-table .backups-rows .backup-row .backup-actions svg.aioseo-trash:hover{color:#df2a4a}.aioseo-backup-settings .backups-table .backups-rows .backup-row .backup-actions svg.aioseo-refresh{margin-left:10px}.aioseo-backup-settings .backups-table .backups-rows .backup-row .backup-actions svg.aioseo-refresh:hover{color:#00aa63}.aioseo-backup-settings svg.aioseo-circle-plus{width:14px;height:14px;margin-left:10px}.aioseo-backup-settings .aioseo-modal-body{padding:20px 50px 50px;display:flex;align-items:center;justify-content:center;flex-direction:column;position:relative}.aioseo-backup-settings .aioseo-modal-body h3{font-size:20px;margin-bottom:16px}.aioseo-backup-settings .aioseo-modal-body .reset-description{font-size:16px;color:#141b38;margin-bottom:16px;text-align:center;max-width:515px}.aioseo-backup-settings .aioseo-modal-body button.close{position:absolute;left:11px;top:11px;width:24px;height:24px;background-color:#fff;border:none;display:flex;align-items:center}.aioseo-backup-settings .aioseo-modal-body button.close svg.aioseo-close{cursor:pointer;width:14px;height:14px}.aioseo-backup-settings .aioseo-modal-body .aioseo-description{max-width:510px;text-align:center}.aioseo-backup-settings .aioseo-modal-body .aioseo-button:not(.close){margin-top:16px} | 2,419 | 2,419 | 0.815213 |
8f01c0766e6fe908a41972b098932492cbfcd60e | 2,276 | rs | Rust | maistra/vendor/proxy_wasm_cpp_host__regalloc__0_0_31/src/pretty_print.rs | knm3000/proxy | f2bb57b7294aea2cb344824785be42849d7d63c9 | [
"Apache-2.0"
] | 70 | 2020-04-04T18:47:24.000Z | 2022-02-20T00:05:56.000Z | maistra/vendor/proxy_wasm_cpp_host__regalloc__0_0_31/src/pretty_print.rs | knm3000/proxy | f2bb57b7294aea2cb344824785be42849d7d63c9 | [
"Apache-2.0"
] | 54 | 2020-06-23T17:34:04.000Z | 2022-03-31T02:04:06.000Z | maistra/vendor/proxy_wasm_cpp_host__regalloc__0_0_31/src/pretty_print.rs | knm3000/proxy | f2bb57b7294aea2cb344824785be42849d7d63c9 | [
"Apache-2.0"
] | 16 | 2020-04-09T22:37:24.000Z | 2022-03-20T19:15:25.000Z | //! Pretty-printing for the main data structures.
use crate::data_structures::WritableBase;
use crate::{RealRegUniverse, Reg, Writable};
/// A trait for printing instruction bits and pieces, with the the ability to take a
/// contextualising `RealRegUniverse` that is used to give proper names to registers.
pub trait PrettyPrint {
/// Return a string that shows the implementing object in context of the given
/// `RealRegUniverse`, if provided.
fn show_rru(&self, maybe_reg_universe: Option<&RealRegUniverse>) -> String;
}
/// Same as `PrettyPrint`, but can also take a size hint into account to specialize the displayed
/// string.
pub trait PrettyPrintSized: PrettyPrint {
/// The same as |show_rru|, but with an optional hint giving a size in bytes. Its
/// interpretation is object-dependent, and it is intended to pass around enough information to
/// facilitate printing sub-parts of real registers correctly. Objects may ignore size hints
/// that are irrelevant to them.
///
/// The default implementation ignores the size hint.
fn show_rru_sized(&self, maybe_reg_universe: Option<&RealRegUniverse>, _size: u8) -> String {
self.show_rru(maybe_reg_universe)
}
}
impl PrettyPrint for Reg {
fn show_rru(&self, maybe_reg_universe: Option<&RealRegUniverse>) -> String {
if self.is_real() {
if let Some(rru) = maybe_reg_universe {
let reg_ix = self.get_index();
assert!(
reg_ix < rru.regs.len(),
"unknown real register with index {:?}",
reg_ix
);
return rru.regs[reg_ix].1.to_string();
}
}
// The reg is virtual, or we have no universe. Be generic.
format!("%{:?}", self)
}
}
impl<R: PrettyPrint + WritableBase> PrettyPrint for Writable<R> {
fn show_rru(&self, maybe_reg_universe: Option<&RealRegUniverse>) -> String {
self.to_reg().show_rru(maybe_reg_universe)
}
}
impl<R: PrettyPrintSized + WritableBase> PrettyPrintSized for Writable<R> {
fn show_rru_sized(&self, maybe_reg_universe: Option<&RealRegUniverse>, size: u8) -> String {
self.to_reg().show_rru_sized(maybe_reg_universe, size)
}
}
| 39.929825 | 99 | 0.661248 |
2f0e3960616ebbe8c4e363fda70c0cb6393f9317 | 51,480 | php | PHP | seller/application/views/preview.php | admin731/craftsindian | ecc1e6e8ebb0e016b3790e6bfb01f5771dc7276d | [
"MIT"
] | null | null | null | seller/application/views/preview.php | admin731/craftsindian | ecc1e6e8ebb0e016b3790e6bfb01f5771dc7276d | [
"MIT"
] | null | null | null | seller/application/views/preview.php | admin731/craftsindian | ecc1e6e8ebb0e016b3790e6bfb01f5771dc7276d | [
"MIT"
] | null | null | null | <?php
if($details['is_variant'] == 1){
$price = '';
$discount = '';
$net = '';
}else{
$price = $details['product_price'];
$discount = $details['discount'];
$net = $details['net'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Men Blue Skinny Fit Mid-Rise Clean Look Stretchable Jeans | Craftsindian</title>
<meta name="author" content="Craft Store" />
<meta name="description" content="Men Blue Skinny Fit Mid-Rise Clean Look Stretchable Jeans Hand Made Crafts, Paper Crafts, Metal Crafts, Wood Crafts, Tread Craft." />
<meta name="keywords" content="Men Blue Skinny Fit Mid-Rise Clean Look Stretchable Jeans Hand Made Crafts, Paper Crafts, Metal Crafts, Wood Crafts, Tread Craft." />
<meta name="Resource-type" content="Document" />
<link rel="stylesheet" type="text/css" href="http://blubeads.madhees.com/asets/css/animate.css"/>
<link rel="stylesheet" type="text/css" href="http://blubeads.madhees.com/asets/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="http://blubeads.madhees.com/asets/css/style.css"/>
<link rel="stylesheet" type="text/css" href="http://blubeads.madhees.com/asets/css/mdb.min.css"/>
<link rel="stylesheet" type="text/css" href="http://blubeads.madhees.com/asets/css/font-awesome.min.css"/>
<link href="https://fonts.googleapis.com/css?family=Fjalla+One" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">
<link rel="stylesheet" href="http://blubeads.madhees.com/asets/css/zoom.css">
<link href="http://blubeads.madhees.com/asets/css/multi/custom.css" rel="stylesheet">
<link rel="stylesheet" href="http://blubeads.madhees.com/asets/css/jquery-ui.css">
<!-- <link rel="stylesheet" href="http://blubeads.madhees.com/css/filter/reset.css"> --><!-- CSS reset -->
<link rel="stylesheet" href="http://blubeads.madhees.com/asets/css/filter/style.css"> <!-- Resource style -->
<link href = "http://blubeads.madhees.com/asets/css/filter/jquery-ui.css" rel = "stylesheet">
<script src="http://blubeads.madhees.com/asets/js/filter/modernizr.js"></script>
<script src="http://blubeads.madhees.com/asets/js/filter/jquery-1.10.2.min.js"></script>
<script src="http://blubeads.madhees.com/asets/js/filter/jquery-ui.js"></script>
<script>
$(document).ready(function(){
$('[data-toggle="popover"]').popover();
});
</script>
</head>
<body data-spy="scroll" data-target="#myScrollspy" data-offset="0">
<a href='http://blubeads.madhees.com/seller'><span class="become-a-seller" title="Become a Seller" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Easy steps to be a Seller" ></span></a>
<div class="header-top-section fixtop" id="header_fix">
<div class="container no-pad">
<div class="col-md-2 col-sm-2 col-xs-6 logo">
<a href="http://blubeads.madhees.com/"><img src="http://blubeads.madhees.com/asets/images/logo.png" ></a>
</div>
<div class="col-md-2 col-sm-2 col-xs-6 category_blk">
<div id="dl-menu" class="dl-menuwrapper hidden-sm hidden-md hidden-lg">
<button class="dl-trigger pull-right">Open Menu</button>
<ul class="dl-menu">
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/1/icons8-checked-user-male-48.png" class="hicon">men</a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/men/jeans/ct?cci=WHVyYmxUL0ljSjU4RVN0eE5mcWpUUT09">Jeans</a></li>
<li><a href="http://blubeads.madhees.com/men/mens-belts/ct?cci=d3R1c2gxN3RucUQyMFV0bHhLeUIwQT09">Mens Belts</a></li>
<li><a href="http://blubeads.madhees.com/men/t-shirts/ct?cci=L1NOQlBwa0JpM0xYY1U1NHVaRXVvUT09">T-Shirts</a></li>
<li><a href="http://blubeads.madhees.com/men/foot-wear/ct?cci=N3prUG9vUnFUQlZGRXpwTnBtUksrdz09">Foot Wear</a></li>
<li><a href="http://blubeads.madhees.com/men/innerwear/ct?cci=NzhaS1I5WGVSUGIyNVRib3k4N2drQT09">Innerwear</a></li>
<li><a href="http://blubeads.madhees.com/men/watches/ct?cci=N2doTkxsV0xHb2FwZkFnRXdNRmZPUT09">Watches</a></li>
</ul>
</li>
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/2/icons8-collaborator-female-48.png" class="hicon">women</a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/women/t-shirts-for-womens/ct?cci=dVRRSDZYS0FldUpYYVJkTm9PV3Jmdz09">T-shirts For Womens</a></li>
<li><a href="http://blubeads.madhees.com/women/foot-wear/ct?cci=dENZZUhRYUc1Q2VaOFp1U0xFdW0xZz09">Foot Wear</a></li>
<li><a href="http://blubeads.madhees.com/women/kurtas-suits/ct?cci=TjlFRWFqS0czdXJvV3FDendnekJLdz09">Kurtas & Suits</a></li>
</ul>
</li>
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/8/kids-couplef.png" class="hicon">kids</a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/kids/boys-wear/ct?cci=aVBCTFM2VlpBWnE0TWZhaG42b0h4Zz09">Boys Wear</a></li>
<li><a href="http://blubeads.madhees.com/kids/girls-wear/ct?cci=T0FweFRUNklGR3daSjczMkNtS3Z1Zz09">Girls Wear</a></li>
</ul>
</li>
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/9/icons8-wood-48.png" class="hicon">wood crafts</a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/wood-crafts/stand-crafts/ct?cci=aDhnVVR2aUpudGxlUllDQ1V5SDBjQT09">Stand crafts</a></li>
</ul>
</li>
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/12/icons8-cloakroom-48.png" class="hicon">clothes</a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/clothes/party-wear/ct?cci=S09TNG5SamVXUDNsc3c2dytHaTBtUT09">Party Wear</a></li>
<li><a href="http://blubeads.madhees.com/clothes/traditional-wear/ct?cci=UnlwTFFWcXN3d1VIcVNzdzJraHFLQT09">Traditional Wear</a></li>
</ul>
</li>
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/19/cosmetic-brush_(1)1.png" class="hicon">skin care</a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/skin-care/handmade-soaps/ct?cci=bFUxalhRdWJtc1FubFpVYnRDbUNtdz09">Handmade Soaps</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/hand-body-wash/ct?cci=OHJHYXZJSWhta0owK0ZHcnNZNm9mUT09">Hand & Body Wash</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/face-body-powders/ct?cci=TGdSaDFpVS9obnNMZWs5dVpOMkN5UT09">Face & Body Powders</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/creams-lotions/ct?cci=aG4wKzUwaDlLRU04MnlHOWJjOEFrZz09">Creams & Lotions</a></li>
</ul>
</li>
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/21/check-mark.png" class="hicon">accessories </a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/accessories/mobiles/ct?cci=elpES0lVU2RRcEp3MGRFS05Vbys1Zz09">mobiles</a></li>
</ul>
</li>
<li><a href="#"><img src="http://blubeads.madhees.com/upload/category/25/1.jpg" class="hicon">toys </a>
<ul class="dl-submenu">
<li><a href="http://blubeads.madhees.com/toys/kondapalli-toys/ct?cci=dldXeVAyTk81WGRKcjRzMHpmYmZzZz09">kondapalli toys</a></li>
</ul>
</li>
</ul>
</div><!-- /dl-menuwrapper -->
<div id="navbar">
<ul class="nav navbar-nav hidden-xs">
<li class="dropdown ">
<a href="#" class="cat_btn" data-toggle="dropdown"><i class="fa fa-th-list hicon" aria-hidden="true"></i>Categories <b class="caret"></b></a>
<ul class="dropdown-menu cat-menu outer-menu">
<span class="close-cross"><a href="javascript:;" onclick="$('.cat-menu').toggle();" style="color:red; font-size:18px" aria-expanded="false">✖</a></span>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/1/icons8-checked-user-male-48.png" class="hicon"> Men</a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item1 " id="act_1" class="" >
<a href="http://blubeads.madhees.com/men/jeans/ct?cci=WHVyYmxUL0ljSjU4RVN0eE5mcWpUUT09" class="sub_cat" id="1|1/71h8dgxex2l__ux385_.jpg|1">Jeans</a></li>
<li class="menu_item1 " id="act_4" >
<a href="http://blubeads.madhees.com/men/mens-belts/ct?cci=d3R1c2gxN3RucUQyMFV0bHhLeUIwQT09" class="sub_cat" id="1|4/belts.jpg|4">Mens Belts</a></li>
<li class="menu_item1 " id="act_16" >
<a href="http://blubeads.madhees.com/men/t-shirts/ct?cci=L1NOQlBwa0JpM0xYY1U1NHVaRXVvUT09" class="sub_cat" id="1|16/pic2.jpg|16">T-Shirts</a></li>
<li class="menu_item1 " id="act_39" >
<a href="http://blubeads.madhees.com/men/foot-wear/ct?cci=N3prUG9vUnFUQlZGRXpwTnBtUksrdz09" class="sub_cat" id="1|39/64e54c2b-2dc6-4469-b69b-c7c1ad5766181549343793508-mast--harbour-men-white-sneakers-9631549343792425-1.jpg|39">Foot Wear</a></li>
<li class="menu_item1 " id="act_40" >
<a href="http://blubeads.madhees.com/men/innerwear/ct?cci=NzhaS1I5WGVSUGIyNVRib3k4N2drQT09" class="sub_cat" id="1|40/11501833149351-jockey-pack-of-2-innerwear-vests-8820-0205-5901501833149178-1.jpg|40">Innerwear</a></li>
<li class="menu_item1 " id="act_41" >
<a href="http://blubeads.madhees.com/men/watches/ct?cci=N2doTkxsV0xHb2FwZkFnRXdNRmZPUT09" class="sub_cat" id="1|41/p5.jpg|41">Watches</a></li>
</ul>
</li>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/2/icons8-collaborator-female-48.png" class="hicon"> Women</a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item2 " id="act_5" class="" >
<a href="http://blubeads.madhees.com/women/t-shirts-for-womens/ct?cci=dVRRSDZYS0FldUpYYVJkTm9PV3Jmdz09" class="sub_cat" id="2|5/6cf8b022-362b-46a8-a11d-8f326bdbde261533631524161-mango-women-tshirts-7191533631524026-1.jpg|5">T-shirts For Womens</a></li>
<li class="menu_item2 " id="act_18" >
<a href="http://blubeads.madhees.com/women/foot-wear/ct?cci=dENZZUhRYUc1Q2VaOFp1U0xFdW0xZz09" class="sub_cat" id="2|18/74.jpg|18">Foot Wear</a></li>
<li class="menu_item2 " id="act_38" >
<a href="http://blubeads.madhees.com/women/kurtas-suits/ct?cci=TjlFRWFqS0czdXJvV3FDendnekJLdz09" class="sub_cat" id="2|38/kurthas1.jpg|38">Kurtas & Suits</a></li>
</ul>
</li>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/8/kids-couplef.png" class="hicon"> Kids</a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item8 " id="act_6" class="" >
<a href="http://blubeads.madhees.com/kids/boys-wear/ct?cci=aVBCTFM2VlpBWnE0TWZhaG42b0h4Zz09" class="sub_cat" id="8|6/boys-dress-clothes-trends-and-tendencies-2017-boys-fashion-boys-clothes-2017-5.jpg|6">Boys Wear</a></li>
<li class="menu_item8 " id="act_7" >
<a href="http://blubeads.madhees.com/kids/girls-wear/ct?cci=T0FweFRUNklGR3daSjczMkNtS3Z1Zz09" class="sub_cat" id="8|7/51pvnfv+ccl__sx342_ql70_.jpg|7">Girls Wear</a></li>
</ul>
</li>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/9/icons8-wood-48.png" class="hicon"> Wood Crafts</a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item9 " id="act_8" class="" >
<a href="http://blubeads.madhees.com/wood-crafts/stand-crafts/ct?cci=aDhnVVR2aUpudGxlUllDQ1V5SDBjQT09" class="sub_cat" id="9|8/unnamed.jpg|8">Stand Crafts</a></li>
</ul>
</li>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/12/icons8-cloakroom-48.png" class="hicon"> Clothes</a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item12 " id="act_10" class="" >
<a href="http://blubeads.madhees.com/clothes/party-wear/ct?cci=S09TNG5SamVXUDNsc3c2dytHaTBtUT09" class="sub_cat" id="12|10/ab_pic.jpg|10">Party Wear</a></li>
<li class="menu_item12 " id="act_11" >
<a href="http://blubeads.madhees.com/clothes/traditional-wear/ct?cci=UnlwTFFWcXN3d1VIcVNzdzJraHFLQT09" class="sub_cat" id="12|11/71.jpg|11">Traditional Wear</a></li>
</ul>
</li>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/19/cosmetic-brush_(1)1.png" class="hicon"> Skin Care</a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item19 " id="act_19" class="" >
<a href="http://blubeads.madhees.com/skin-care/handmade-soaps/ct?cci=bFUxalhRdWJtc1FubFpVYnRDbUNtdz09" class="sub_cat" id="19|19/soapd.jpg|19">Handmade Soaps</a></li>
<li class="menu_item19 " id="act_20" >
<a href="http://blubeads.madhees.com/skin-care/hand-body-wash/ct?cci=OHJHYXZJSWhta0owK0ZHcnNZNm9mUT09" class="sub_cat" id="19|20/brics_handwash_150ml1_3d296d20-5fd3-4d2c-a6d0-7945793d47da_grande.jpg|20">Hand & Body Wash</a></li>
<li class="menu_item19 " id="act_21" >
<a href="http://blubeads.madhees.com/skin-care/face-body-powders/ct?cci=TGdSaDFpVS9obnNMZWs5dVpOMkN5UT09" class="sub_cat" id="19|21/organic_luxury_bath_powder__product_1_1525842615973_1024x1024.jpg|21">Face & Body Powders</a></li>
<li class="menu_item19 " id="act_22" >
<a href="http://blubeads.madhees.com/skin-care/creams-lotions/ct?cci=aG4wKzUwaDlLRU04MnlHOWJjOEFrZz09" class="sub_cat" id="19|22/revitalizing_fruit_anti_aging_creme_product_1_1528463254161_1024x1024.jpg|22">Creams & Lotions</a></li>
</ul>
</li>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/21/check-mark.png" class="hicon"> Accessories </a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item21 " id="act_23" class="" >
<a href="http://blubeads.madhees.com/accessories/mobiles/ct?cci=elpES0lVU2RRcEp3MGRFS05Vbys1Zz09" class="sub_cat" id="21|23/mobile.jpg|23">Mobiles</a></li>
</ul>
</li>
<li class="cat-sub_menu outer-sub-menu" ><a style="cursor: context-menu;" ><img src="http://blubeads.madhees.com/upload/category/25/1.jpg" class="hicon"> Toys </a>
<ul class="sub-menu-listw" style="padding-top:5px;">
<li class="menu_item25 " id="act_43" class="" >
<a href="http://blubeads.madhees.com/toys/kondapalli-toys/ct?cci=dldXeVAyTk81WGRKcjRzMHpmYmZzZz09" class="sub_cat" id="25|43/kondapalli.jpg|43">Kondapalli Toys</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<form id="search_product" method="get" action="http://blubeads.madhees.com/search">
<div class="col-md-4 col-sm-3 col-xs-12 padding-0">
<div class="input-group search-block " style="margin:5px 0px">
<input type="text" class="form-control my-0 py-1 amber-border" placeholder="I am looking for.." id="prodct_name" autocomplete="on" name="keyword" autocomplete="off" value="">
<ul class="dropdown-menu txtproduct" style="margin-left:50px;margin-right:0px;" role="menu" aria-labelledby="dropdownMenu" id="DropdownProduct"></ul>
<span class="input-group-btn">
<div class="btn btn-default search-submit" >
<span class="glyphicon glyphicon-search" id ="submit_search"></span></div>
</span>
</div>
</div>
</form>
<div class="col-md-4 col-sm-4 col-xs-12 text-right cart-block">
<ul class="list-inline top-social level-0 ul-no-margin">
<li><a href="#" role="button" data-toggle="modal" data-target="#sign-up"><i class="fa fa-user" aria-hidden="true"></i>Sign Up</a></li>
<li><a href="#" role="button" data-toggle="modal" data-target="#login-modal"><i class="fa fa-sign-in" aria-hidden="true"></i>Log In</a><li>
<li><a href="http://blubeads.madhees.com/Viewcart"><span class="cs2"><i class="fa fa-shopping-cart hicon" aria-hidden="true"></i>MyCart <span id="cart_count"></span></span></a></li>
</ul>
</div>
</div>
</div>
<div class="section1 z-depth-1 hidden-xs" id="small_head">
<div class="container">
<ul class="fa-ul list-inline top-info level-0 ul-no-margin">
<span class="bc">Quick Search <i class="fa fa-long-arrow-right"></i></span>
<li><a href="http://blubeads.madhees.com/women/t-shirts-for-womens/ct?cci=dVRRSDZYS0FldUpYYVJkTm9PV3Jmdz09">T-shirts For Womens</a></li>
<li><a href="http://blubeads.madhees.com/wood-crafts/stand-crafts/ct?cci=aDhnVVR2aUpudGxlUllDQ1V5SDBjQT09">Stand crafts</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/hand-body-wash/ct?cci=OHJHYXZJSWhta0owK0ZHcnNZNm9mUT09">Hand & Body Wash</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/creams-lotions/ct?cci=aG4wKzUwaDlLRU04MnlHOWJjOEFrZz09">Creams & Lotions</a></li>
<li><a href="http://blubeads.madhees.com/men/foot-wear/ct?cci=N3prUG9vUnFUQlZGRXpwTnBtUksrdz09">Foot Wear</a></li>
</ul>
</div>
</div>
<!-- Login Modal -->
<div class="modal fade" id="sign-up" tabindex="-1" role="dialog" aria-labelledby="Sign_UpLable" aria-hidden="true">
<div class="modal-dialog sign-up-m-body">
<div class="modal-content form-elegant">
<!--Header-->
<div class="modal-header text-center">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h3 class="modal-title w-100 dark-grey-text font-weight-bold my-3" id="Sign_UpLable"><strong>Sign Up Now</strong></h3>
<p class="log-caption">Enjoy Convenience of a single account across all participating brands.</p>
</div>
<!--Body-->
<div class="modal-body mx-4">
<!--Body-->
<form id="Sign_up_Modal_Form" novalidate="novalidate" >
<div class="md-form mb-5">
<input type="text" id="Sign_name" name="Sign_name" maxlength="30" class="form-control validate">
<label data-error="wrong" data-success="right" for="Sign_name">Name</label>
</div>
<div class="md-form mb-5">
<input type="email" name="Sign_email" id="Sign_email" maxlength="30" class="form-control validate" >
<label data-error="wrong" data-success="right" id="Sing_up_lable" for="Sign_email">Email</label>
</div>
<div class="md-form mb-5">
<input type="text" id="Sign_mobile" name="Sign_mobile" maxlength="10"class="form-control validate" oninput="this.value = this.value.replace(/^[0-5]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" onkeypress="return isNumber(event)">
<label data-error="wrong" data-success="right" for="Sign_mobile">Mobile</label>
</div>
<div class="md-form pb-3">
<input type="password" id="Sign_password" maxlength="15" name="Sign_password" class="form-control validate">
<label data-error="wrong" data-success="right" for="Sign_password">Password</label>
</div>
<div class="md-form pb-3 option-group">
<p class="font-small d-flex justify-content-end"><input type="checkbox" id="term_cond" name="term_cond" type="checkbox"> I want to be a part of Blubeads .By opting in I agree to <a href="http://blubeads.madhees.com/terms_conditions" target="_blank"><u>Terms & Conditions</u></a> of Blubeads</p>
</div>
<div class="text-center mb-3">
<center><span id="Sign_msg"></span></center>
<button type="submit" class="btn blue-gradient btn-block z-depth-1a">Sign Up</button>
</div>
</form>
</div>
<!--Footer-->
<div class="modal-footer mx-5 pt-3 mb-1">
<p class="font-small grey-text d-flex justify-content-end">Already have an account? <a href="javascript:;" id="User_SignIn_modal" class="blue-text ml-1"> Log In</a></p>
</div>
</div>
</div>
</div>
<!-- END # BOOTSNIP INFO -->
<!-- BEGIN # MODAL LOGIN -->
<!-- Modal -->
<div class="modal fade" id="login-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<!--Content-->
<div class="modal-content form-elegant">
<!--Header-->
<div class="modal-header text-center">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h3 class="modal-title w-100 dark-grey-text font-weight-bold my-3" id="myModalLabel"><strong>Log In Now</strong></h3>
<p class="log-caption">Enjoy Convenience of a single account across all participating brands.</p>
</div>
<!--Body-->
<div class="modal-body mx-4">
<!--Body-->
<form id="Sign_in_form" novalidate="novalidate">
<div class="md-form mb-5">
<input type="email" name="Sign_in_email" maxlength="30" id="Sign_in_email" class="form-control validate">
<label data-error="wrong" data-success="right" id="Sing_in_lable" for="Sign_in_email">Your email</label>
</div>
<div class="md-form pb-3">
<input type="password" id="Sign_in_pass" maxlength="15" name="Sign_in_pass" class="form-control validate">
<label data-error="wrong" data-success="right" for="Sign_in_pass">Your password</label>
</div>
<div class="md-form pb-3">
<p class="font-small pull-right blue-text d-flex justify-content-end"><a href="javascript:;" id="Forgot_password" class="blue-text ml-1">Forgot Password?</a></p>
</div>
<div class="text-center mb-3">
<button type="submit" class="btn blue-gradient btn-block z-depth-1a">Log in</button>
<center><span id="Sign_in_msg"></span></center>
</div>
</form>
<p class="font-small dark-grey-text text-center d-flex justify-content-center mb-3 pt-2"> or</p>
<div class="row my-3 d-flex text-center">
<a href="javascript:;" scope="email" onclick="facebooklogin();" style="float:left"> <img src="http://blubeads.madhees.com/asets/images/Facebook-logo-login.png" class="img-responsive" ></a>
<!-- <fb:login-button >login</fb:login-button> -->
<a href="http://blubeads.madhees.com/google_login"><img src="http://blubeads.madhees.com/asets/images/google-logo-login.png" class="img-responsive"></a>
</div>
</div>
<div class="modal-footer mx-5 pt-3 mb-1">
<p class="font-small grey-text d-flex justify-content-end">Not a member? <a href="javascript:;" id="User_SignUp_modal" class="blue-text ml-1"> Sign Up</a></p>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="otp-verification-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm" role="document">
<!--Content-->
<div class="modal-content form-elegant">
<!--Header-->
<div class="modal-header text-center">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h3 class="modal-title w-100 dark-grey-text font-weight-bold my-3" id="myModalLabel"><strong>Verify OTP</strong></h3>
</div>
<!--Body-->
<div class="modal-body mx-4">
<!--Body-->
<form id="verify_otp_form" novalidate="novalidate">
<div class="md-form mb-5">
<input type="number" name="otp" id="otp" onkeydown="if(this.value.length==6 && event.keyCode!=8) return false;" class="form-control validate">
<input type="hidden" name="mobileno" id="mobileno">
<label data-error="wrong" data-success="right" id="verify_otp" for="verify_otp">Enter OTP</label>
</div>
<div class="md-form pb-3">
</div>
<div class="text-center mb-3">
<button type="submit" class="btn blue-gradient btn-block z-depth-1a">Verify OTP</button>
<a href="javascript:;" onClick="Resend_otp()"> <h6 id=""><strong>Resend OTP</strong></h3></h6></a>
<center><span id="otp_verified_msg"></span></center>
</div>
</form>
</div>
<!--Footer-->
<div class="modal-footer mx-5 pt-3 mb-1">
</div>
</div>
<!--/.Content-->
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="Forgot_pass-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<!--Content-->
<div class="modal-content form-elegant">
<!--Header-->
<div class="modal-header text-center">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h3 class="modal-title w-100 dark-grey-text font-weight-bold my-3" id="myModalLabel"><strong>Forgot Password</strong></h3>
<p class="log-caption">If loass your password don't warry about.</p>
</div>
<!--Body-->
<div class="modal-body mx-4">
<!--Body-->
<form id="Forgot_pass_form" novalidate="novalidate">
<div class="md-form mb-5">
<input type="email" name="Forgot_in_email" id="Forgot_in_email" class="form-control validate">
<label data-error="wrong" data-success="right" id="fotgot_in_lable" for="Sign_in_email">Your email</label>
</div>
<div class="md-form pb-3">
<p class="font-small pull-right blue-text d-flex justify-content-end"><a href="javascript:;" id="forUser_SignIn_modal" class="blue-text ml-1">Login?</a></p>
</div>
<div class="text-center mb-3">
<button type="submit" class="btn blue-gradient btn-block z-depth-1a">Submit</button>
<center><span id="Forgot_msg"></span></center>
</div>
</form>
</div>
<!--Footer-->
</div>
<!--/.Content-->
</div>
</div>
<div class="modal fade" id="google_sign_up_modal" tabindex="-1" role="dialog" aria-labelledby="Gsign_UpLable" aria-hidden="true">
<div class="modal-dialog sign-up-m-body">
<div class="modal-content form-elegant">
<!--Header-->
<div class="modal-header text-center">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h3 class="modal-title w-100 dark-grey-text font-weight-bold my-3" id="Gsign_UpLable"><strong>Mobile Verification</strong></h3>
<p class="log-caption">Enter your 10 digits mobile number and you get OTP.</p>
</div>
<!--Body-->
<div class="modal-body mx-4">
<!--Body-->
<form id="google_login_form" novalidate="novalidate" >
<div class="md-form mb-5">
<input type="hidden" name="insert_id" id="insert_id" value="">
<input type="number" oninput="this.value = this.value.replace(/^[0-5]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"onKeyDown="if(this.value.length==10 && event.keyCode!=8) return false;" id="mobile_no" name="mobile_no" class="form-control validate">
<label data-error="wrong" data-success="right" for="Sign_number">Mobile Number</label>
</div>
<div class="text-center mb-3">
<center><span id="Gmail_Sign_msg"></span></center>
<button type="submit" class="btn blue-gradient btn-block z-depth-1a">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- <script>
window.fbAsyncInit = function() {
FB.init({
appId : '2256284051314409',
autoLogAppEvents : true,
xfbml : true,
version : 'v3.2'
});
};
</script>
<script async defer src="https://connect.facebook.net/en_US/sdk.js"></script> -->
<!-- Initialize element with Multislider -->
<!-- Modal -->
<!-- END # MODAL LOGIN -->
<div class="container view-product-byid ">
<div class="hcw">
<div class="container">
<span class="sub"><a href="http://blubeads.madhees.com/"> Home </a> / men / Jeans </span>
</div>
</div>
<div class="container nopad">
<div class="col-lg-5 col-md-6 col-sm-6 col-xs-12">
<div class="product_images_view" >
<div class="detimg " >
<ul id="etalage">
<li>
<img class="etalage_thumb_image" src="http://blubeads.madhees.com/upload/product/92//product92-201903120959491552384789131.jpg" />
<img class="etalage_source_image" src="http://blubeads.madhees.com/upload/product/92//product92-201903120959491552384789131.jpg" />
</li>
<li>
<img class="etalage_thumb_image" src="http://blubeads.madhees.com/upload/product/92//product92-201903121000341552384834131.jpg" />
<img class="etalage_source_image" src="http://blubeads.madhees.com/upload/product/92//product92-201903121000341552384834131.jpg" />
</li>
</ul>
</div>
</div>
</div>
<div class="col-lg-7 col-md-6 col-sm-6 col-xs-12" >
<div class="details">
<h3 class="product-title"><?php echo $details['product_name'];?><span id="opt_names"></span></h3>
<h4 class="price">Price: <span id="p_price"><i class="fa fa-inr" aria-hidden="true"></i> <?php echo $net ?></span> <span class="not"><small id="p_gross"><i class="fa fa-inr" aria-hidden="true"></i> <?php echo $price ?></small></span><small><span class="green-clr" id="p_disc"> (<?php echo $discount ?>% Off)</span></small> | <a href="#" >
<span class="favorite-icon padding-left-17" id="buttons" ><i class="heart favorite-icon i" id="like2" rel=""></i></span>
</a></h4><div class="list-points">
<?php $disc = strip_tags($details['product_description']); echo substr($disc,0,300).'..'; ?> .. </div>
<div class="delivery">
<br>
<div class="input-group" >
<label>Delivery <i class="glyphicon glyphicon-map-marker"></i></label>
<div class="form-group pincode_chck">
<input type="number" pattern="\d{6}" class="form-control" maxlength="6" id="pincode" placeholder="Enter Pincode">
</div>
<span id="check_pincode_msg"></span>
</div>
</div>
<div class="colors">
<h5 class="sizes"><span id="var_name1">Color </span>:</h5>
<div class="color_sel" id="select_div_1">
<div class="col-xs-2 variant_img variant_10" id="130"><a href="javascript:;" class="acitve "><img src="http://blubeads.madhees.com/upload/product/92//product92-201903120959091552384749130.jpg" class="thumb-1" data-toggle="tooltip" data-placement="bottom" title=""> </a></div><input type="checkbox" style="display:none" name="variant1" class="cart__img opt_1" value="130"><span class="inact_img_n" style="display:none">GREY</span><div class="col-xs-2 variant_img variant_1" id="131"><a href="javascript:;" class="acitve "><img src="http://blubeads.madhees.com/upload/product/92//product92-201903120959491552384789131.jpg" class="thumb-1" data-toggle="tooltip" data-placement="bottom" title=""> </a></div><input type="checkbox" style="display:none" name="variant1" checked=checked class="cart__img opt_1" value="131"><span class="act_img_n" style="display:none">BLUE</span>
</div>
</div>
<div class="sizes">
<div class="alert-static " id="select_div_2">
<span id="var_name2">size</span> :<lable class="size " data-toggle="tooltip" data-placement="bottom" title=""><a href="javascript:;" class="variant_2 opt_inactive other_variant" data-id="132" data-name="XS" id="2">XS<input name="variant2" value="132" type="checkbox" class="d-none opt_2" /></a></lable><lable class="size " data-toggle="tooltip" data-placement="bottom" title=""><a href="javascript:;" class="variant_2 opt_inactive other_variant" data-id="133" data-name="S" id="2">S<input name="variant2" value="133" type="checkbox" class="d-none opt_2" /></a></lable><lable class="size " data-toggle="tooltip" data-placement="bottom" title=""><a href="javascript:;" class="variant_2 opt_inactive other_variant" data-id="134" data-name="L" id="2">L<input name="variant2" value="134" type="checkbox" class="d-none opt_2" /></a></lable><lable class="size " data-toggle="tooltip" data-placement="bottom" title=""><a href="javascript:;" class="variant_2 opt_inactive other_variant" data-id="135" data-name="M" id="2">M<input name="variant2" value="135" type="checkbox" class="d-none opt_2" /></a></lable> </div>
</div>
<div class="details_end"></div>
</div>
<br>
<div class="col-md-12 col-sm-12 col-xs-12 margin-top-15 pl-0" >
<a href="javascript:void(0)">
<button type="button" class="buycar btn btn-warning" >BUY NOW</button>
</a>
<a href="javascript:void(0)"><button type="button" class="buycar btn btn-info" id="add-cart-btn" >ADD TO CART</button></a>
</div>
</div>
</div>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="sotab">
<ul class="nav nav-tabs pro-details">
<li class="active"><a data-toggle="tab" href="#home">Product Details</a></li>
<li><a data-toggle="tab" href="#menu1">Reviews</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active padding-15">
<?php ?> </div>
<div id="menu1" class="tab-pane fade padding-15">
<div class="review-block">
<div><p class="text-center n-data" >NO REVIEWS</p></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="overlay" ></div>
<style type="text/css">
#loading
{
text-align:center;
background: url('http://blubeads.madhees.com/asets/images/loader.gif') no-repeat center;
height: 150px;
}
</style>
<input type="hidden" name="" id="product_max_qty" value="3">
<input type="hidden" name="" id="product_id" value="92">
<input type="hidden" name="" id="product_variants" value="1,2">
<input type="hidden" name="" id="pavailable" value="">
<input type="hidden" name="" id="pcode" value=" 213861280823329">
<input type="hidden" name="" id="doller_sym" value="<i class="fa fa-inr" aria-hidden="true"></i>">
<div class="container padding-0"></div>
<section class="pattern-in">
<div class="container">
<div class="row">
<div id="recently-viewed-items" class="ms-PAUSE" >
<div class="row">
<div class="col-md-9 col-sm-6 col-xs-6">
<h3 class="multislider-head">RECENTLY VIEWED ITEMS</h3>
</div>
<div class="col-md-3 col-sm-6 col-xs-6">
<!-- Controls -->
</div>
</div>
<div class="MS-content">
<div class="item z-depth-1">
<a href="http://blubeads.madhees.com/men-blue-skinny-fit-mid-rise-clean-look-stretchable-jeans/p/b3g5UWVEOVRuRXFiM3RLU3dEWFdBZGpoU3ZJQTdOTGYrcnJRL2lXSEdpVT0=?did=MEM0L0dhblJ2ZDZzc3hKR3RRZjVwQT09" style="height:30%;width:30%"><img class="img-responsive" id="92" src="http://blubeads.madhees.com/upload/product/92/product92-201903121000341552384834131.jpg" alt=""/></a>
<div class="cont-cap text-center">
<a href="http://blubeads.madhees.com/men-blue-skinny-fit-mid-rise-clean-look-stretchable-jeans/p/b3g5UWVEOVRuRXFiM3RLU3dEWFdBZGpoU3ZJQTdOTGYrcnJRL2lXSEdpVT0=?did=MEM0L0dhblJ2ZDZzc3hKR3RRZjVwQT09">
<h2>Men Blue Skinny Fit ...</h2>
<p>Blue medium wash 5-pocket...</p>
</a>
<h3 class="product_price"><span class="clr-yelow"><i class="fa fa-inr" aria-hidden="true"></i></span> 7.38 <s class="light-color"><span class="clr-gray"><i class="fa fa-inr" aria-hidden="true"></i></span> 9</s> <span class="discount"> (18% Off)</span></h3>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="section5 z-depth-1" style="/*background-image:url(http://blubeads.madhees.com/asets/images/footerbg.jpg);text-align:center;*/ background-color: #3e3e3e; margin-top:50px;">
<div class="container text-center">
<div class="col-md-3 col-sm-3 col-xs-6">
<a style="cursor: context-menu;"><i class="fa fa-handshake-o" aria-hidden="true"></i><h4>CRAFT TRUST</h4></a>
</div>
<div class="col-md-3 col-sm-3 col-xs-6">
<a style="cursor: context-menu;"><i class="mdi mdi-cart-plus" aria-hidden="true"></i><img src="http://blubeads.madhees.com/asets/images/easyreturns.png" class="easy"><h4>FREE & EASY RETURNS</h4></a>
</div>
<div class="col-md-3 col-sm-3 col-xs-6">
<a style="cursor: context-menu;"><i class="fa fa-map-marker" aria-hidden="true"></i><h4>TRACK YOUR ORDER</h4></a>
</div>
<div class="col-md-3 col-sm-3 col-xs-6">
<a style="cursor: context-menu;"><i class="fa fa-times-circle-o" aria-hidden="true"></i><h4>ONLINE CANCELLATIONS</h4></a>
</div>
</div>
</div>
<!--FOOTER 2-->
<footer class="footer2 z-depth-1">
<div class="footer">
<div class="container">
<div class="row">
<nav class="col-md-3 col-sm-6 col-xs-12">
<h3>SHOPPING</h3>
<ul>
<li>
<a onclick="open_login_modal()">My Account</a>
</li>
<li>
<a onclick="open_login_modal()">Shopping Cart</a>
</li>
<li>
<a onclick="open_login_modal()">Track Order</a>
</li>
</ul>
</nav>
<nav class="col-md-3 col-sm-6 col-xs-12">
<h3>ABOUT BLUBEADS</h3>
<ul>
<li>
<a href="http://blubeads.madhees.com/about">About US</a>
</li>
<li>
<a href="http://blubeads.madhees.com/privacy">Privacy Policy</a>
</li>
<li>
<a href="http://blubeads.madhees.com/terms_conditions">Terms & Conditions</a>
</li>
<li>
<a href="http://blubeads.madhees.com/return_policy">Return Policy</a>
</li>
</ul>
</nav>
<nav class="col-md-3 col-sm-6 col-xs-12">
<h3>CUSTOMER SERVICE</h3>
<ul>
<li>
<a href="http://blubeads.madhees.com/contact_us">Contact Us</a>
</li>
<li>
<a onclick="location.href='http://blubeads.madhees.com/seller'">Sell with us</a>
</li>
<li>
<a href="http://blubeads.madhees.com/frequently_asked_questions">Faq's</a>
</li>
<!-- <li>
<a href="#">Rewards Points</a>
</li> -->
</ul>
</nav>
<nav class="col-md-3 col-sm-6 col-xs-12">
<h3>GET IN TOUCH</h3>
<p>Tollfree : 040 969 5805</p>
<h3>SUBSCRIBE FOR SPECIAL OFFERS</h3>
<div class="input-group input-group-md">
<input type="email" id="subscribe_email" class="form-control" placeholder="Your Email">
<span class="input-group-addon email_subscribe" onclick="emailSubscribe();">Subscribe</span>
</div>
<span id="subscribe_email_msg"></span>
<span id="email-sub" class="text-danger"></span>
</nav>
<hr>
<div class="foot-cat">
<h3>Categories</h3>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Men</b></li>
<li><a href="http://blubeads.madhees.com/men/jeans/ct?cci=WHVyYmxUL0ljSjU4RVN0eE5mcWpUUT09">Jeans</a></li>
<li><a href="http://blubeads.madhees.com/men/mens-belts/ct?cci=d3R1c2gxN3RucUQyMFV0bHhLeUIwQT09">Mens Belts</a></li>
<li><a href="http://blubeads.madhees.com/men/t-shirts/ct?cci=L1NOQlBwa0JpM0xYY1U1NHVaRXVvUT09">T-Shirts</a></li>
<li><a href="http://blubeads.madhees.com/men/foot-wear/ct?cci=N3prUG9vUnFUQlZGRXpwTnBtUksrdz09">Foot Wear</a></li>
<li><a href="http://blubeads.madhees.com/men/innerwear/ct?cci=NzhaS1I5WGVSUGIyNVRib3k4N2drQT09">Innerwear</a></li>
<li><a href="http://blubeads.madhees.com/men/watches/ct?cci=N2doTkxsV0xHb2FwZkFnRXdNRmZPUT09">Watches</a></li>
</ul>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Women</b></li>
<li><a href="http://blubeads.madhees.com/women/t-shirts-for-womens/ct?cci=dVRRSDZYS0FldUpYYVJkTm9PV3Jmdz09">T-shirts For Womens</a></li>
<li><a href="http://blubeads.madhees.com/women/foot-wear/ct?cci=dENZZUhRYUc1Q2VaOFp1U0xFdW0xZz09">Foot Wear</a></li>
<li><a href="http://blubeads.madhees.com/women/kurtas-suits/ct?cci=TjlFRWFqS0czdXJvV3FDendnekJLdz09">Kurtas & Suits</a></li>
</ul>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Kids</b></li>
<li><a href="http://blubeads.madhees.com/kids/boys-wear/ct?cci=aVBCTFM2VlpBWnE0TWZhaG42b0h4Zz09">Boys Wear</a></li>
<li><a href="http://blubeads.madhees.com/kids/girls-wear/ct?cci=T0FweFRUNklGR3daSjczMkNtS3Z1Zz09">Girls Wear</a></li>
</ul>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Wood Crafts</b></li>
<li><a href="http://blubeads.madhees.com/wood-crafts/stand-crafts/ct?cci=aDhnVVR2aUpudGxlUllDQ1V5SDBjQT09">Stand Crafts</a></li>
</ul>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Clothes</b></li>
<li><a href="http://blubeads.madhees.com/clothes/party-wear/ct?cci=S09TNG5SamVXUDNsc3c2dytHaTBtUT09">Party Wear</a></li>
<li><a href="http://blubeads.madhees.com/clothes/traditional-wear/ct?cci=UnlwTFFWcXN3d1VIcVNzdzJraHFLQT09">Traditional Wear</a></li>
</ul>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Skin Care</b></li>
<li><a href="http://blubeads.madhees.com/skin-care/handmade-soaps/ct?cci=bFUxalhRdWJtc1FubFpVYnRDbUNtdz09">Handmade Soaps</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/hand-body-wash/ct?cci=OHJHYXZJSWhta0owK0ZHcnNZNm9mUT09">Hand & Body Wash</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/face-body-powders/ct?cci=TGdSaDFpVS9obnNMZWs5dVpOMkN5UT09">Face & Body Powders</a></li>
<li><a href="http://blubeads.madhees.com/skin-care/creams-lotions/ct?cci=aG4wKzUwaDlLRU04MnlHOWJjOEFrZz09">Creams & Lotions</a></li>
</ul>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Accessories </b></li>
<li><a href="http://blubeads.madhees.com/accessories/mobiles/ct?cci=elpES0lVU2RRcEp3MGRFS05Vbys1Zz09">Mobiles</a></li>
</ul>
<ul class="fa-ul list-inline bottom-info level-0 ul-no-margin">
<li><b>Toys </b></li>
<li><a href="http://blubeads.madhees.com/toys/kondapalli-toys/ct?cci=dldXeVAyTk81WGRKcjRzMHpmYmZzZz09">Kondapalli Toys</a></li>
</ul>
</div>
</div> <!--/.row-->
</div> <!--/.container-->
</div> <!--/.footer-->
<div class="footer-bottom">
<div class="container">
<div class="col-md-6">
<p>
<ul class="social">
<li> <a href="https://www.facebook.com/blubeadss/"> <i class=" fa fa-facebook"> </i> </a> </li>
<li> <a href="https://twitter.com/blubeadss"> <i class="fa fa-twitter"> </i> </a> </li>
<!-- <li> <a href="#"> <i class="fa fa-google-plus"> </i> </a> </li> -->
<li> <a href="https://in.pinterest.com/blubeads/"> <i class="fa fa-pinterest"> </i> </a> </li>
<li> <a href="https://www.youtube.com/channel/UCoayeQunyfLuTmbtmvO379g"> <i class="fa fa-youtube"> </i> </a> </li>
</ul><br><br><br>
© 2019 - Blubeads- All rights reserved. </p></div>
<!-- <div class="col-md-6">
<ul class="nav nav-pills payments">
<li><img src="http://blubeads.madhees.com/asets/images/card1.png" class="foot-img"></li>
<li><img src="http://blubeads.madhees.com/asets/images/card2.png" class="foot-img"></li>
<li><img src="http://blubeads.madhees.com/asets/images/card3.png" class="foot-img"></li>
<li><img src="http://blubeads.madhees.com/asets/images/card4.png" class="foot-img"></li>
</ul>
</div> -->
</div>
</div> <!--/.footer-bottom-->
</footer>
<script src="http://blubeads.madhees.com/asets/js/jquery.min.js"></script>
<script src="http://blubeads.madhees.com/asets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://blubeads.madhees.com/asets/js/jquery-ui.js"></script>
<!-- <script src="http://blubeads.madhees.com/asets/js/support.js"></script> -->
<script src="http://blubeads.madhees.com/asets/js/wow.min.js"></script>
<script type="text/javascript" src="http://blubeads.madhees.com/asets/js/mdb.min.js"></script>
<!-- Include jQuery -->
<!-- Include Multislider -->
<script src="http://blubeads.madhees.com/asets/js/multi/multislider.min.js"></script>
<script type="text/javascript" src="http://blubeads.madhees.com/asets/js/jquery.validate.min.js" ></script>
<script type="text/javascript" src="http://blubeads.madhees.com/asets/js/jquery.etalage.min.js"></script><script>jQuery(document).ready(function($){$("#etalage").etalage({thumb_image_width: 300,thumb_image_height: 400,source_image_width: 900,source_image_height: 1200,show_hint: true,smallthumb_hide_single:false,smallthumbs_position: "left"});});</script> <script type='text/javascript'> $('#recently-viewed-items').multislider();</script>
<script type="text/javascript"></script>
<script type="text/javascript" src="http://blubeads.madhees.com/asets/js/custom.js" ></script>
<!-- Initialize element with Multislider -->
<script src="http://blubeads.madhees.com/asets/js/alert.js"></script>
</body>
</html> | 36.330275 | 1,182 | 0.568998 |
dc0545906ed842c9dc7137b6832079b7caeaed30 | 645 | py | Python | setup.py | deresmos/gssetting | 6c6a30bc048194930337b3253b14aba65144e06a | [
"MIT"
] | null | null | null | setup.py | deresmos/gssetting | 6c6a30bc048194930337b3253b14aba65144e06a | [
"MIT"
] | null | null | null | setup.py | deresmos/gssetting | 6c6a30bc048194930337b3253b14aba65144e06a | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
requires = ["google-auth", "gspread", "requests"]
with open("README.md", "r", encoding="utf-8") as f:
readme = f.read()
setup(
name="gssetting",
version="0.0.1",
description="Load setting value from Google Sheets",
long_description=readme,
long_description_content_type="text/markdown",
author="deresmos",
author_email="deresmos@google.com",
url="https://github.com/deresmos/gssetting",
python_requires=">=3.7",
packages=find_packages(),
include_package_data=False,
keywords=["tools"],
license="MIT License",
install_requires=requires,
)
| 26.875 | 56 | 0.685271 |
1d916b17ba410da2b26080d394981367de8e6746 | 262 | swift | Swift | ios/Lift/LiftServer/NotificationModel.swift | muvr/open-muvr | eb2e6ed1966ce9f2dc56dc2bc2e3a7f80a300d2c | [
"Apache-2.0"
] | 59 | 2015-03-08T17:32:22.000Z | 2018-07-08T04:04:29.000Z | ios/Lift/LiftServer/NotificationModel.swift | muvr/open-muvr | eb2e6ed1966ce9f2dc56dc2bc2e3a7f80a300d2c | [
"Apache-2.0"
] | 1 | 2015-03-29T17:11:11.000Z | 2015-03-29T17:11:11.000Z | ios/Lift/LiftServer/NotificationModel.swift | muvr/open-muvr | eb2e6ed1966ce9f2dc56dc2bc2e3a7f80a300d2c | [
"Apache-2.0"
] | 17 | 2015-03-12T18:40:50.000Z | 2018-03-10T00:49:33.000Z | import Foundation
struct Notification {
struct Notification {
var alert: String
var category: String
var title: String?
}
struct AmbiguousExerciseNotification {
var notification: Notification
var exercises: [Exercise.Exercise]
}
} | 16.375 | 40 | 0.71374 |
c7fa898578b52bf1146ee451c2354400ad617a4f | 9,969 | lua | Lua | entities/entities/bw_base_moneyprinter.lua | CaveeJohnson/basewars-2015-final | a86b9848be126977c19f6e2b5654b02d183c30c4 | [
"MIT"
] | null | null | null | entities/entities/bw_base_moneyprinter.lua | CaveeJohnson/basewars-2015-final | a86b9848be126977c19f6e2b5654b02d183c30c4 | [
"MIT"
] | 1 | 2020-06-26T00:03:26.000Z | 2020-06-26T12:06:42.000Z | entities/entities/bw_base_moneyprinter.lua | CaveeJohnson/basewars-2015-final | a86b9848be126977c19f6e2b5654b02d183c30c4 | [
"MIT"
] | 2 | 2020-06-02T22:15:09.000Z | 2021-02-10T22:11:50.000Z | local fontName = "BaseWars.MoneyPrinter"
ENT.Base = "bw_base_electronics"
ENT.Model = "models/props_lab/reciever01a.mdl"
ENT.Skin = 0
ENT.Capacity = 10000
ENT.Money = 0
ENT.MaxPaper = 2500
ENT.PrintInterval = 1
ENT.PrintAmount = 8
ENT.MaxLevel = 25
ENT.UpgradeCost = 1000
ENT.PrintName = "Basic Printer"
ENT.IsPrinter = true
ENT.IsValidRaidable = false
ENT.MoneyPickupSound = Sound("mvm/mvm_money_pickup.wav")
ENT.UpgradeSound = Sound("replay/rendercomplete.wav")
local Clamp = math.Clamp
function ENT:GSAT(vartype, slot, name, min, max)
self:NetworkVar(vartype, slot, name)
local getVar = function(minMax)
if self[minMax] and isfunction(self[minMax]) then return self[minMax](self) end
if self[minMax] and isnumber(self[minMax]) then return self[minMax] end
return minMax or 0
end
self["Get" .. name] = function(self)
return tonumber(self.dt[name])
end
self["Set" .. name] = function(self, var)
if isstring(self.dt[name]) then
self.dt[name] = tostring(var)
else
self.dt[name] = var
end
end
self["Add" .. name] = function(_, var)
local Val = self["Get" .. name](self) + var
if min and max then
Val = Clamp(Val or 0, getVar(min), getVar(max))
end
if isstring(self["Get" .. name](self)) then
self["Set" .. name](self, Val)
else
self["Set" .. name](self, Val)
end
end
self["Take" .. name] = function(_, var)
local Val = self["Get" .. name](self) - var
if min and max then
Val = Clamp(Val or 0, getVar(min), getVar(max))
end
if isstring(self["Get" .. name](self)) then
self["Set" .. name](self, Val)
else
self["Set" .. name](self, Val)
end
end
end
function ENT:StableNetwork()
self:GSAT("String", 2, "Capacity")
self:SetCapacity("0")
self:GSAT("String", 3, "Money", 0, "GetCapacity")
self:SetMoney("0")
self:GSAT("Int", 4, "Paper", 0, "MaxPaper")
self:GSAT("Int", 5, "Level", 0, "MaxLevel")
end
if SERVER then
AddCSLuaFile()
function ENT:Init()
self.time = CurTime()
self.time_p = CurTime()
self:SetCapacity(self.Capacity)
self:SetPaper(self.MaxPaper)
self:SetHealth(self.PresetMaxHealth or 100)
self.rtb = 0
self.FontColor = color_white
self.BackColor = color_black
self:SetNWInt("UpgradeCost", self.UpgradeCost)
self:SetLevel(1)
end
function ENT:SetUpgradeCost(val)
self.UpgradeCost = val
self:SetNWInt("UpgradeCost", val)
end
function ENT:Upgrade(ply, supress)
local lvl = self:GetLevel()
local calcM = self:GetNWInt("UpgradeCost") * lvl
if ply then
local plyM = ply:GetMoney()
if plyM < calcM then
if not supress then ply:Notify(BaseWars.LANG.UpgradeNoMoney, BASEWARS_NOTIFICATION_ERROR) end
return false end
if lvl >= self.MaxLevel then
if not supress then ply:Notify(BaseWars.LANG.UpgradeMaxLevel, BASEWARS_NOTIFICATION_ERROR) end
return false end
ply:TakeMoney(calcM)
end
self.CurrentValue = (self.CurrentValue or 0) + calcM
self:AddLevel(1)
self:EmitSound(self.UpgradeSound)
return true
end
function ENT:ThinkFunc()
if self.Disabled or self:BadlyDamaged() then return end
local added
local level = self:GetLevel() ^ 1.3
if CurTime() >= self.PrintInterval + self.time and self:GetPaper() > 0 then
local m = self:GetMoney()
self:AddMoney(math.Round(self.PrintAmount * level))
self.time = CurTime()
added = m ~= self:GetMoney()
end
if CurTime() >= self.PrintInterval * 2 + self.time_p and added then
self.time_p = CurTime()
self:TakePaper(1)
end
end
function ENT:PlayerTakeMoney(ply)
local money = self:GetMoney()
local Res, Msg = hook.Run("BaseWars_PlayerCanEmptyPrinter", ply, self, money)
if Res == false then
if Msg then
ply:Notify(Msg, BASEWARS_NOTIFICATION_ERROR)
end
return end
self:TakeMoney(money)
ply:GiveMoney(money)
ply:EmitSound(self.MoneyPickupSound)
hook.Run("BaseWars_PlayerEmptyPrinter", ply, self, money)
end
function ENT:UseFuncBypass(activator, caller, usetype, value)
if self.Disabled then return end
if activator:IsPlayer() and caller:IsPlayer() and self:GetMoney() > 0 then
self:PlayerTakeMoney(activator)
end
end
function ENT:SetDisabled(a)
self.Disabled = a and true or false
self:SetNWBool("printer_disabled", a and true or false)
end
else
function ENT:Initialize()
if not self.FontColor then self.FontColor = color_white end
if not self.BackColor then self.BackColor = color_black end
end
surface.CreateFont(fontName, {
font = "Roboto",
size = 20,
weight = 800,
})
surface.CreateFont(fontName .. ".Huge", {
font = "Roboto",
size = 64,
weight = 800,
})
surface.CreateFont(fontName .. ".Big", {
font = "Roboto",
size = 32,
weight = 800,
})
surface.CreateFont(fontName .. ".MedBig", {
font = "Roboto",
size = 24,
weight = 800,
})
surface.CreateFont(fontName .. ".Med", {
font = "Roboto",
size = 18,
weight = 800,
})
local WasPowered
if CLIENT then
function ENT:DrawDisplay(pos, ang, scale)
local w, h = 216 * 2, 136 * 2
local disabled = self:GetNWBool("printer_disabled")
local Pw = self:IsPowered()
local Lv = self:GetLevel()
local Cp = self:GetCapacity()
draw.RoundedBox(4, 0, 0, w, h, Pw and self.BackColor or color_black)
if not Pw then return end
if disabled then
draw.DrawText(BaseWars.LANG.PrinterBeen, fontName, w / 2, h / 2 - 48, self.FontColor, TEXT_ALIGN_CENTER)
draw.DrawText(BaseWars.LANG.Disabled, fontName .. ".Huge", w / 2, h / 2 - 32, Color(255,0,0), TEXT_ALIGN_CENTER)
return end
draw.DrawText(self.PrintName, fontName, w / 2, 4, self.FontColor, TEXT_ALIGN_CENTER)
if disabled then return end
--Level
surface.SetDrawColor(self.FontColor)
surface.DrawLine(0, 30, w, 30)--draw.RoundedBox(0, 0, 30, w, 1, self.FontColor)
draw.DrawText(string.format(BaseWars.LANG.LevelText, Lv):upper(), fontName .. ".Big", 4, 32, self.FontColor, TEXT_ALIGN_LEFT)
surface.DrawLine(0, 68, w, 68)--draw.RoundedBox(0, 0, 68, w, 1, self.FontColor)
draw.DrawText(BaseWars.LANG.Cash, fontName .. ".Big", 4, 72, self.FontColor, TEXT_ALIGN_LEFT)
-- draw.RoundedBox(0, 0, 72 + 32, w, 1, self.FontColor)
local money = self:GetMoney() or 0
local cap = tonumber(Cp) or 0
local moneyPercentage = math.Round( money / cap * 100 ,1)
--Percentage done
draw.DrawText( moneyPercentage .."%" , fontName .. ".Big", w - 4, 71, self.FontColor, TEXT_ALIGN_RIGHT)
--Money/Maxmoney
local currentMoney = string.format(BaseWars.LANG.CURFORMER, BaseWars.NumberFormat(money))
local maxMoney = string.format(BaseWars.LANG.CURFORMER, BaseWars.NumberFormat(cap))
local font = fontName .. ".Big"
if #currentMoney > 16 then
font = fontName .. ".MedBig"
end
if #currentMoney > 20 then
font = fontName .. ".Med"
end
local fh = draw.GetFontHeight(font)
local StrW,StrH = surface.GetTextSize(" / ")
draw.DrawText(" / " , font,
w/2 - StrW/2 , (font == fontName .. ".Big" and 106 or 105 + fh / 4), self.FontColor, TEXT_ALIGN_LEFT)
local moneyW,moneyH = surface.GetTextSize(currentMoney)
draw.DrawText(currentMoney , font,
w/2 - StrW/2 - moneyW , (font == fontName .. ".Big" and 106 or 105 + fh / 4), self.FontColor, TEXT_ALIGN_LEFT)
draw.DrawText( maxMoney, font,
w/2 + StrW/2 , (font == fontName .. ".Big" and 106 or 105 + fh / 4), self.FontColor, TEXT_ALIGN_Right)
--Paper
local paper = math.floor(self:GetPaper())
draw.DrawText(string.format(BaseWars.LANG.Paper, paper), fontName .. ".MedBig", 4, 94 + 49, self.FontColor, TEXT_ALIGN_LEFT)
--draw.RoundedBox(0, 0, 102 + 37, w, 1, self.FontColor)
surface.DrawLine(0, 102 + 37, w, 102 + 37)
local NextCost = string.format(BaseWars.LANG.CURFORMER, BaseWars.NumberFormat(self:GetLevel() * self:GetNWInt("UpgradeCost")))
if self:GetLevel() >= self.MaxLevel then
NextCost = BaseWars.LANG.MaxLevel
end
surface.DrawLine(0, 142 + 25, w, 142 + 25)--draw.RoundedBox(0, 0, 142 + 25, w, 1, self.FontColor)
draw.DrawText(string.format(BaseWars.LANG.NextUpgrade, NextCost), fontName .. ".MedBig", 4, 84 + 78 + 10, self.FontColor, TEXT_ALIGN_LEFT)
surface.DrawLine(0, 142 + 25, w, 142 + 25)--draw.RoundedBox(0, 0, 142 + 55, w, 1, self.FontColor)
--Time remaining counter
local timeRemaining = 0
timeRemaining = math.Round( (cap - money) / (self.PrintAmount * Lv / self.PrintInterval) )
if timeRemaining > 0 then
local PrettyHours = math.floor(timeRemaining/3600)
local PrettyMinutes = math.floor(timeRemaining/60) - PrettyHours*60
local PrettySeconds = timeRemaining - PrettyMinutes*60 - PrettyHours*3600
local PrettyTime = (PrettyHours > 0 and PrettyHours..BaseWars.LANG.HoursShort or "") ..
(PrettyMinutes > 0 and PrettyMinutes..BaseWars.LANG.MinutesShort or "") ..
PrettySeconds..BaseWars.LANG.SecondsShort
draw.DrawText(string.format(BaseWars.LANG.UntilFull, PrettyTime), fontName .. ".Big", w-4 , 32, self.FontColor, TEXT_ALIGN_RIGHT)
else
draw.DrawText(BaseWars.LANG.Full, fontName .. ".Big", w-4 , 32, self.FontColor, TEXT_ALIGN_RIGHT)
end
--Money bar BG
local BoxX = 88
local BoxW = 265
draw.RoundedBox(0, BoxX, 74, BoxW , 24, self.FontColor)
--Money bar gap
if cap > 0 and cap ~= math.huge then
local moneyRatio = money / cap
local maxWidth = math.floor(BoxW - 6)
local curWidth = maxWidth * (1-moneyRatio)
draw.RoundedBox(0, w - BoxX - curWidth + 6 , 76, curWidth , 24 - 4, self.BackColor)
end
end
function ENT:Calc3D2DParams()
local pos = self:GetPos()
local ang = self:GetAngles()
pos = pos + ang:Up() * 3.09
pos = pos + ang:Forward() * -7.35
pos = pos + ang:Right() * 10.82
ang:RotateAroundAxis(ang:Up(), 90)
return pos, ang, 0.1 / 2
end
end
function ENT:Draw()
self:DrawModel()
if CLIENT then
local pos, ang, scale = self:Calc3D2DParams()
cam.Start3D2D(pos, ang, scale)
pcall(self.DrawDisplay, self, pos, ang, scale)
cam.End3D2D()
end
end
end
| 27.538674 | 141 | 0.680108 |
d991536bfe348977f255994c8ac81b15acaf9bce | 8,218 | rs | Rust | glib/src/key_file.rs | jf2048/gtk-rs-core | 02de84c94e50145604a9187fdfa1460a155bb723 | [
"MIT-0",
"MIT"
] | null | null | null | glib/src/key_file.rs | jf2048/gtk-rs-core | 02de84c94e50145604a9187fdfa1460a155bb723 | [
"MIT-0",
"MIT"
] | null | null | null | glib/src/key_file.rs | jf2048/gtk-rs-core | 02de84c94e50145604a9187fdfa1460a155bb723 | [
"MIT-0",
"MIT"
] | null | null | null | // Take a look at the license at the top of the repository in the LICENSE file.
use crate::error::Error;
use crate::gstring::GString;
use crate::translate::*;
use crate::KeyFileFlags;
use std::mem;
use std::path;
use std::ptr;
use crate::KeyFile;
impl KeyFile {
#[doc(alias = "g_key_file_save_to_file")]
pub fn save_to_file<T: AsRef<std::path::Path>>(&self, filename: T) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ffi::g_key_file_save_to_file(
self.to_glib_none().0,
filename.as_ref().to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_load_from_data_dirs")]
pub fn load_from_data_dirs<T: AsRef<std::path::Path>>(
&self,
file: T,
flags: KeyFileFlags,
) -> Result<path::PathBuf, Error> {
unsafe {
let mut error = ptr::null_mut();
let mut full_path: *mut libc::c_char = ptr::null_mut();
let _ = ffi::g_key_file_load_from_data_dirs(
self.to_glib_none().0,
file.as_ref().to_glib_none().0,
&mut full_path,
flags.into_glib(),
&mut error,
);
if error.is_null() {
let path: GString = from_glib_full(full_path);
Ok(path::PathBuf::from(&path))
} else {
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_load_from_dirs")]
pub fn load_from_dirs<T: AsRef<std::path::Path>, U: AsRef<std::path::Path>>(
&self,
file: T,
search_dirs: &[U],
flags: KeyFileFlags,
) -> Result<path::PathBuf, Error> {
unsafe {
let search_dirs: Vec<&std::path::Path> =
search_dirs.iter().map(AsRef::as_ref).collect();
let mut error = ptr::null_mut();
let mut full_path: *mut libc::c_char = ptr::null_mut();
let _ = ffi::g_key_file_load_from_dirs(
self.to_glib_none().0,
file.as_ref().to_glib_none().0,
search_dirs.to_glib_none().0,
&mut full_path,
flags.into_glib(),
&mut error,
);
if error.is_null() {
let path: GString = from_glib_full(full_path);
Ok(path::PathBuf::from(&path))
} else {
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_to_data")]
pub fn to_data(&self) -> GString {
unsafe {
let ret =
ffi::g_key_file_to_data(self.to_glib_none().0, ptr::null_mut(), ptr::null_mut());
from_glib_full(ret)
}
}
#[doc(alias = "g_key_file_get_boolean")]
#[doc(alias = "get_boolean")]
pub fn boolean(&self, group_name: &str, key: &str) -> Result<bool, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::g_key_file_get_boolean(
self.to_glib_none().0,
group_name.to_glib_none().0,
key.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib(ret))
} else {
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_has_key")]
pub fn has_key(&self, group_name: &str, key: &str) -> Result<bool, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::g_key_file_has_key(
self.to_glib_none().0,
group_name.to_glib_none().0,
key.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib(ret))
} else {
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_get_boolean_list")]
#[doc(alias = "get_boolean_list")]
pub fn boolean_list(&self, group_name: &str, key: &str) -> Result<Vec<bool>, Error> {
unsafe {
let mut length = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let ret = ffi::g_key_file_get_boolean_list(
self.to_glib_none().0,
group_name.to_glib_none().0,
key.to_glib_none().0,
length.as_mut_ptr(),
&mut error,
);
if !error.is_null() {
return Err(from_glib_full(error));
}
Ok(FromGlibContainer::from_glib_container_num(
ret,
length.assume_init() as usize,
))
}
}
#[doc(alias = "g_key_file_get_string")]
#[doc(alias = "get_string")]
pub fn string(&self, group_name: &str, key: &str) -> Result<GString, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::g_key_file_get_string(
self.to_glib_none().0,
group_name.to_glib_none().0,
key.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
ffi::g_free(ret as *mut _);
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_get_string_list")]
#[doc(alias = "get_string_list")]
pub fn string_list(&self, group_name: &str, key: &str) -> Result<Vec<GString>, Error> {
unsafe {
let mut length = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let ret = ffi::g_key_file_get_string_list(
self.to_glib_none().0,
group_name.to_glib_none().0,
key.to_glib_none().0,
length.as_mut_ptr(),
&mut error,
);
if error.is_null() {
Ok(FromGlibContainer::from_glib_full_num(
ret,
length.assume_init() as usize,
))
} else {
ffi::g_strfreev(ret);
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_get_locale_string")]
#[doc(alias = "get_locale_string")]
pub fn locale_string(
&self,
group_name: &str,
key: &str,
locale: Option<&str>,
) -> Result<GString, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::g_key_file_get_locale_string(
self.to_glib_none().0,
group_name.to_glib_none().0,
key.to_glib_none().0,
locale.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
ffi::g_free(ret as *mut _);
Err(from_glib_full(error))
}
}
}
#[doc(alias = "g_key_file_get_locale_string_list")]
#[doc(alias = "get_locale_string_list")]
pub fn locale_string_list(
&self,
group_name: &str,
key: &str,
locale: Option<&str>,
) -> Result<Vec<GString>, Error> {
unsafe {
let mut length = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let ret = ffi::g_key_file_get_locale_string_list(
self.to_glib_none().0,
group_name.to_glib_none().0,
key.to_glib_none().0,
locale.to_glib_none().0,
length.as_mut_ptr(),
&mut error,
);
if error.is_null() {
Ok(FromGlibContainer::from_glib_full_num(
ret,
length.assume_init() as usize,
))
} else {
ffi::g_strfreev(ret);
Err(from_glib_full(error))
}
}
}
}
| 32.101563 | 97 | 0.480774 |
a5a7491e826a080769ba1377ad47f541c9cb5f73 | 985 | swift | Swift | Sources/macOS/Extensions/AppKit/NSCollectionView+.swift | AQUArchitect/MyKit | a9d4c8f15e178fab959b6032c411a7a08e688435 | [
"MIT"
] | null | null | null | Sources/macOS/Extensions/AppKit/NSCollectionView+.swift | AQUArchitect/MyKit | a9d4c8f15e178fab959b6032c411a7a08e688435 | [
"MIT"
] | null | null | null | Sources/macOS/Extensions/AppKit/NSCollectionView+.swift | AQUArchitect/MyKit | a9d4c8f15e178fab959b6032c411a7a08e688435 | [
"MIT"
] | null | null | null | //
// NSCollectionView+.swift
// MyKit
//
// Created by Hai Nguyen.
// Copyright (c) 2017 Hai Nguyen.
//
import AppKit
@available(OSX 10.11, *)
public extension NSCollectionView {
/// Return an estimated range of item indexes that are visible in bounds.
///
/// The calculation uses `estimatedNumberOfVisibleElements` and only works
/// for a simple flow layout and single section collection view.
var estimatedRangeOfVisibleItems: CountableRange<Int> {
guard self.numberOfSections == 1,
let flowLayout = self.collectionViewLayout as? NSCollectionViewFlowLayout,
let minIndex = self.indexPathsForVisibleItems().min()?.item
else { return 0..<0 }
return minIndex..<(minIndex + flowLayout.estimatedNumberOfVisibleElements)
}
@available(*, deprecated, renamed: "estimatedRangeOfVisibleItems")
var maximumRangeOfVisibleItems: CountableRange<Int> {
return estimatedRangeOfVisibleItems
}
}
| 30.78125 | 86 | 0.701523 |
777f14bc6d9345a1a427307d7d1592f125892f01 | 919 | asm | Assembly | cards/bn5/ItemCards/136-F003 Sal's Lunch Freebies.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | 10 | 2017-12-05T14:25:38.000Z | 2022-02-21T04:28:00.000Z | cards/bn5/ItemCards/136-F003 Sal's Lunch Freebies.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | cards/bn5/ItemCards/136-F003 Sal's Lunch Freebies.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | .include "defaults_item.asm"
table_file_jp equ "exe5-utf8.tbl"
table_file_en equ "bn5-utf8.tbl"
game_code_len equ 3
game_code equ 0x4252424A // BRBJ
game_code_2 equ 0x42524245 // BRBE
game_code_3 equ 0x42524250 // BRBP
card_type equ 0
card_id equ 23
card_no equ "023"
card_sub equ "Item Card 023"
card_sub_x equ 62
card_desc_len equ 1
card_desc_1 equ "Sal's Lunch Freebies"
card_desc_2 equ ""
card_desc_3 equ ""
card_name_jp_full equ "サロマさんのお弁当のおまけ"
card_name_jp_game equ "サロマさんのおべんとうのおまけ"
card_name_en_full equ "Sal's Lunch Freebies"
card_name_en_game equ "Sal's Lunch Freebies"
card_game_desc_jp_len equ 3
card_game_desc_jp_1 equ "サロマさんのおべんとうのおまけ!"
card_game_desc_jp_2 equ "ブーメランA、バンブーランス*、"
card_game_desc_jp_3 equ "マヨイノモリ*を手に入れた!"
card_game_desc_en_len equ 3
card_game_desc_en_1 equ "Sal's lunch freebies!"
card_game_desc_en_2 equ "Got Boomer A,Lance *"
card_game_desc_en_3 equ "and AntiWood *!" | 30.633333 | 47 | 0.797606 |
16fbff51bfdc4953b99aade1fedb2c076001e686 | 61 | tsx | TypeScript | src/views/ThankYouAndExistPage/hooks/index.tsx | tinkerhub/jenga-ui | 75c7d863cd1323bafd7d80a5ea63f9afcd27f8a3 | [
"MIT"
] | 5 | 2020-11-26T14:21:33.000Z | 2021-05-31T10:34:31.000Z | src/views/ThankYouAndExistPage/hooks/index.tsx | tinkerhub-org/jenga-ui | 75c7d863cd1323bafd7d80a5ea63f9afcd27f8a3 | [
"MIT"
] | null | null | null | src/views/ThankYouAndExistPage/hooks/index.tsx | tinkerhub-org/jenga-ui | 75c7d863cd1323bafd7d80a5ea63f9afcd27f8a3 | [
"MIT"
] | 3 | 2021-08-04T17:09:30.000Z | 2021-08-11T15:05:24.000Z | export { useThankYouAndExist } from './useThankYouAndExist';
| 30.5 | 60 | 0.786885 |
0ba563c5f1a8e8092fcd4bece03a89610c759cd4 | 2,801 | py | Python | tests/test_sa.py | mariushelf/sa2django | 936b0a70b0ccc8faf3ca26ff241b0b6dac13f204 | [
"MIT"
] | null | null | null | tests/test_sa.py | mariushelf/sa2django | 936b0a70b0ccc8faf3ca26ff241b0b6dac13f204 | [
"MIT"
] | null | null | null | tests/test_sa.py | mariushelf/sa2django | 936b0a70b0ccc8faf3ca26ff241b0b6dac13f204 | [
"MIT"
] | null | null | null | import sqlite3
import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import tests.testsite.testapp.models as dm
from tests.sa_models import Base, Car, Child, Dog, Parent
@pytest.fixture(scope="session")
def engine():
print("NEW ENGINE")
engine = create_engine(
"sqlite://",
creator=lambda: sqlite3.connect(
"file:memorydb?mode=memory&cache=shared", uri=True
),
)
yield engine
engine.dispose()
@pytest.fixture(scope="session")
def session(engine):
print("CREATE TABLES")
Base.metadata.create_all(engine)
session = sessionmaker(bind=engine)()
yield session
session.close()
@pytest.fixture(scope="session")
def mock_data_session(session):
parent = Parent(name="Peter")
parent2 = Parent(name="Hugo")
child1 = Child(name="Hans", age=3, parent=parent, boolfield=True)
child2 = Child(name="Franz", age=5, parent=parent, boolfield=False)
dog1 = Dog(name="Rex")
dog1.owners = [child2]
car1 = Car(horsepower=560)
car2 = Car(horsepower=32)
parent.cars = [car1, car2]
session.add_all([parent, parent2, child1, child2, dog1])
session.commit()
return session
def test_data(mock_data_session):
assert len(mock_data_session.query(Parent).all()) == 2
assert len(mock_data_session.query(Child).all()) == 2
@pytest.mark.django_db
def test_django_orm(mock_data_session):
parents = dm.Parent.objects.order_by("pk")
assert len(parents) == 2
assert parents[0].name == "Peter"
assert parents[1].name == "Hugo"
def test_nullable(mock_data_session):
assert dm.Child._meta.get_field("boolfield").null == False
assert dm.Child._meta.get_field("citextfield").null == True
@pytest.mark.django_db
def test_fk(mock_data_session):
parent = dm.Parent.objects.get(name="Peter")
dm_child = dm.Child.objects.get(name="Hans")
assert dm_child.parent_id == parent.id
assert dm_child.parent == parent
# test back reference
assert len(parent.children.all()) == 2
assert dm_child in parent.children.all()
@pytest.mark.django_db
def test_pk(mock_data_session):
assert dm.Child._meta.pk.name == "key"
assert dm.Parent._meta.pk.name == "id"
@pytest.mark.django_db
def test_many_to_many(mock_data_session):
peter = dm.Parent.objects.get(name="Peter")
assert len(peter.cars.all()) == 2
car0 = dm.Car.objects.all()[0]
assert car0.drivers.all()[0].name == "Peter"
car1 = dm.Car.objects.all()[1]
assert car1.drivers.all()[0].name == "Peter"
@pytest.mark.django_db
def test_relation_without_fk(mock_data_session):
franz = dm.Child.objects.get(name="Franz")
rex = dm.Dog.objects.get(name="Rex")
assert franz.dog == rex
assert list(rex.owners.all()) == [franz]
| 27.194175 | 71 | 0.687612 |
605042a1f75827d9aedd746f4702801a99184d46 | 11,621 | html | HTML | mousepawmedia.com/ratscript.html | mousepawmedia/mpm-websites | b4fc1f41ddb3d32f9c0bfe7e7ee59b3a5284d8c6 | [
"BSD-3-Clause"
] | null | null | null | mousepawmedia.com/ratscript.html | mousepawmedia/mpm-websites | b4fc1f41ddb3d32f9c0bfe7e7ee59b3a5284d8c6 | [
"BSD-3-Clause"
] | null | null | null | mousepawmedia.com/ratscript.html | mousepawmedia/mpm-websites | b4fc1f41ddb3d32f9c0bfe7e7ee59b3a5284d8c6 | [
"BSD-3-Clause"
] | null | null | null | <!DOCTYPE HTML>
<html lang='en-US'>
<head>
<!--#include virtual='/common/commonhead.html' -->
<!--Display information-->
<title>Ratscript</title>
<meta name='author' content='MousePaw Media'>
<meta name='description' content="Ratscript is a brand new programming language with an
original syntax designed to be visual and simple, without
sacrificing functionality.">
<!--Open Graph data (http://ogp.me/)-->
<meta property='og:title' content="Ratscript">
<meta property='og:description' content="Ratscript is a brand new programming language with an
original syntax designed to be visual and simple, without
sacrificing functionality.">
<meta property='og:image' content='https://www.mousepawmedia.com/img/thumbnails/projects/ratscript.jpg'>
<!--Twitter Card data (https://dev.twitter.com/cards/getting-started)-->
<meta name='twitter:card' content='summary'>
<meta name='twitter:site' content='@mousepawmedia'>
<meta name='twitter:creator' content='@mousepawmedia'>
<!--Must be square, >=120px*120px, <1MB -->
<meta name='twitter:image' content='https://www.mousepawmedia.com/img/thumbnails/projects/ratscript.jpg'>
<meta name='twitter:image:alt' content='Ratscript logo over welding photo.'>
</head>
<body>
<!--#include virtual='/common/header.html' -->
<main>
<article class=banner>
<img class=banner src='/img/banners/projects/ratscript.jpg'/>
</article>
<article class=normal>
<section>
<h1>Ratscript</h1>
<p>
Ratscript is a brand new programming language with an
original syntax designed to be visual and simple, without
sacrificing functionality.
</p>
<p>
Let's explore some of Ratscript's syntax and innovations.
(Subject to change.)
</p>
</section>
<section>
<h2>Visual.</h2>
<p>
Ratscript uses brief-yet-obvious keywords. For example,
a new variable can be defined with <code>make</code>.
</p>
<code>
make foo as int = 123<br/>
make lang as string = "Ratscript"
</code>
<p>
Meanwhile, all loops are defined with the <code>loop</code>
keyword.
</p>
<code>
make count as int = 100<br/>
make sum as int = 0<br/>
loop while count > 0<br/>
: sum += count<br/>
: count--<br/>
end loop
</code>
<p>
All lines are simply terminated by a newline.
To continue on a new line, Ratscript takes a cue from
standard English and employs the ellipses (<code>...</code>).
</p>
<code>
make foo = 5 + 5 + 10 + ...<br/>
10 + 10 + 2
</code>
<p>
Ratscript always allows the programmer to decide if they
want to pass it by reference ('<code>foo</code>') or
value ('<code>@foo</code>').
</p>
</section>
<section>
<h2>Mathematical.</h2>
<p>
Ratscript strives to follow as many conventions of written
algebra as possible in its syntax. In addition to obvious
and standard choices (like using parenthesis for function
calls), it borrows conventions like using the caret
(<code>^</code>) symbol for exponents. For example,
<code>2^3</code> would yield 8.
</p>
<p>
In addition to the <code>make</code> keyword used for
declaring variables, Ratscript offers two other keywords.
</p>
<p>
'<code>let</code>' is used to define a "throwaway" variable,
such as a loop iterator. These are always named with one
letter, and infer their type automatically.
</p>
<code>
let i = 0<br/>
loop for i++ from 0 to 100<br/>
: doThing()<br/>
end loop<br/>
</code>
<p>
'<code>define</code>' defines a constant, in the same
way that '<code>make</code>' defines a variable.
</p>
<code>
define ANSWER as int = 42
</code>
</section>
<section>
<h2>Original.</h2>
<p>
Ratscript is our playground for exploring brand new
innovations in programming paradigms and language features.
</p>
<p>
One such innovation is in how code blocks are handled.
Instead of using symbols to enclose a block, or relying
on indentation to define them, Ratscript uses a
"subordination operator", while ignoring all whitespace
surrounding it (thereby allowing optional indentation).
</p>
<code>
make missile as string = "whale"<br/>
if missile == "whale"<br/>
: print("Hello!")<br/>
: print("Who am I?")<br/>
: print("Why am I here?")<br/>
else if missile == "petunias"<br/>
: print("Oh no, not again.")<br/>
else<br/>
: print("Take evasive action!")<br/>
: if missile == "heat-seeking nuclear warhead"<br/>
:: infiniteImprobabilityDrive()<br/>
: else<br/>
:: driveErratically()<br/>
: end if<br/>
end if
</code>
<p>
This convention allows one to immediately determine how
deeply nested a single line is. We'll be exploring
other possible implications of this new convention.
</p>
<p>
For anyone concerned about the annoyance of typing a
"subordination operator", we believe a Ratscript-supported
IDE should be able to alleviate any inconvenience. After
all, brackets and spaces were inconvenient once too!
</p>
</section>
<section class=border-top>
<h2>FAQs: Ratscript</h2>
<p class=center>(Click a question to view the answer.)</p>
<div class=expander tabindex=1>
<p class=days>
Compiled or interpreted?
</p>
<div><p>
Ratscript will most likely be interpreted.
</p></div>
</div>
<div class=expander tabindex=1>
<p class=days>
Statically or dynamically typed?
</p>
<div><p>
We haven't decided for certain yet, but we're
learning towards static typing.
</p></div>
</div>
<div class=expander tabindex=1>
<p class=days>
What paradigms will this language support?
</p>
<div><p>
Initially, Ratscript will support procedural
and object-oriented programming. In later versions,
we plan to support generic and functional
programming, as well as a brand new paradigm we'll
be developing.
</p></div>
</div>
<div class=expander tabindex=1>
<p class=days>
What is Ratscript's license?
</p>
<div><p>
Ratscript is licensed under the
<a href=http://www.opensource.org/licenses/BSD-3-Clause target=_blank>BSD-3-Clause</a>
license, allowing you to use it freely in any project.
</p></div>
</div>
<div class=expander tabindex=1>
<p class=days>
When will Ratscript be ready?
</p>
<div><p>
Ratscript is in active development. It is presently
a high priority task, as we will need it for
Trailcrest and Anari.
</p></div>
</div>
<div class=expander tabindex=1>
<p class=days>
Can I help with development?
</p>
<div><p>
We'd love your help! Check out our
<a href=/developers>Developers</a>
page for details on how you can get involved.
</p></div>
</div>
</section>
</article>
<div class='toggle nav_buttonsquare'>
<p class=rotate><<</p>
</div>
<aside class=sidebar>
<section>
<p class=days><a href='/projects/software'>
More Software
</a></p>
</section>
<section class=border-top>
<br/>
<img class=x-large src=/img/projects/ratscript_weblogo.png alt="Ratscript logo">
<br/><br/>
</section>
<section class=border-top>
<h2>Get Ratscript</h2>
<div class=flex>
<div class='center_content flex_item'>
<a href='https://github.com/mousepawmedia/ratscript' target=_blank>
<img class=icon_medium src='/img/social/github_icon.png'>
<p class='center days'>GitHub</p>
</a>
</div>
</div>
</section>
<section class=border-top>
<h2>You May Also Like...</h2>
<div class=flex>
<div class='center_content flex_item'>
<a href='/projects/libraries/trailcrest'>
<img class='icon_large hoverable framed' src='/img/projects/trailcrest_icon.png'>
<p class='center days'>Trailcrest</p>
</a>
</div>
</div>
</section>
</aside>
</main>
<!--#include virtual='/common/footer.html' -->
</body>
<!--Javascript Modernizer, for backwards compatibility.-->
<script src='/common/js/vendor/modernizr-2.8.3.min.js'></script>
</html>
| 40.491289 | 110 | 0.45478 |
a18d146c0f78a254988b2e24be996d54388fb17d | 570 | c | C | drivers/uart/uart.c | kaightasa/mcube | 545c32f318ae08c4104a3e32e254cba0f45ca6bc | [
"BSD-2-Clause"
] | 40 | 2018-11-23T12:11:54.000Z | 2022-02-14T11:33:33.000Z | drivers/uart/uart.c | kaightasa/mcube | 545c32f318ae08c4104a3e32e254cba0f45ca6bc | [
"BSD-2-Clause"
] | null | null | null | drivers/uart/uart.c | kaightasa/mcube | 545c32f318ae08c4104a3e32e254cba0f45ca6bc | [
"BSD-2-Clause"
] | 8 | 2019-05-19T15:23:17.000Z | 2021-05-14T08:09:47.000Z | /**
* @file drivers/uart/uart.c
*
* @author Hiroyuki Chishiro
*/
#include <mcube/mcube.h>
uint8_t uart_getc(uint8_t ch)
{
uint8_t c;
c = uart_pol_getc(ch);
return c;
}
void uart_putc(char c, uint8_t ch)
{
if (c == '\n') {
uart_pol_putc('\r', ch);
}
uart_pol_putc(c, ch);
}
size_t uart_write(const char *data, size_t length, uint8_t ch)
{
size_t num;
for (num = 0; num < length; num++) {
uart_putc(data[num], ch);
}
return num;
}
size_t uart_read(size_t length, uint8_t ch)
{
__uninitialized(length);
return uart_getc(ch);
}
| 13.255814 | 62 | 0.62807 |
2910adbd61c746388cec1515daf9408697fa4c9a | 647,730 | py | Python | lib/ovirtsdk4/types.py | oliel/python-ovirt-engine-sdk4 | c0b13982b45dee664ebc063bda7686124b402c14 | [
"Apache-2.0"
] | null | null | null | lib/ovirtsdk4/types.py | oliel/python-ovirt-engine-sdk4 | c0b13982b45dee664ebc063bda7686124b402c14 | [
"Apache-2.0"
] | null | null | null | lib/ovirtsdk4/types.py | oliel/python-ovirt-engine-sdk4 | c0b13982b45dee664ebc063bda7686124b402c14 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from enum import Enum, unique
from ovirtsdk4 import Struct
class AffinityRule(Struct):
def __init__(
self,
enabled=None,
enforcing=None,
positive=None,
):
super(AffinityRule, self).__init__(
)
self.enabled = enabled
self.enforcing = enforcing
self.positive = positive
@property
def enforcing(self):
"""
Returns the value of the `enforcing` property.
"""
return self._enforcing
@enforcing.setter
def enforcing(self, value):
"""
Sets the value of the `enforcing` property.
"""
self._enforcing = value
@property
def positive(self):
"""
Returns the value of the `positive` property.
"""
return self._positive
@positive.setter
def positive(self, value):
"""
Sets the value of the `positive` property.
"""
self._positive = value
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class AgentConfiguration(Struct):
def __init__(
self,
address=None,
broker_type=None,
network_mappings=None,
password=None,
port=None,
username=None,
):
super(AgentConfiguration, self).__init__(
)
self.address = address
self.broker_type = broker_type
self.network_mappings = network_mappings
self.password = password
self.port = port
self.username = username
@property
def broker_type(self):
"""
Returns the value of the `broker_type` property.
"""
return self._broker_type
@broker_type.setter
def broker_type(self, value):
"""
Sets the value of the `broker_type` property.
"""
Struct._check_type('broker_type', value, MessageBrokerType)
self._broker_type = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def network_mappings(self):
"""
Returns the value of the `network_mappings` property.
"""
return self._network_mappings
@network_mappings.setter
def network_mappings(self, value):
"""
Sets the value of the `network_mappings` property.
"""
self._network_mappings = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
class Api(Struct):
def __init__(
self,
authenticated_user=None,
effective_user=None,
product_info=None,
special_objects=None,
summary=None,
time=None,
):
super(Api, self).__init__(
)
self.authenticated_user = authenticated_user
self.effective_user = effective_user
self.product_info = product_info
self.special_objects = special_objects
self.summary = summary
self.time = time
@property
def effective_user(self):
"""
Returns the value of the `effective_user` property.
"""
return self._effective_user
@effective_user.setter
def effective_user(self, value):
"""
Sets the value of the `effective_user` property.
"""
Struct._check_type('effective_user', value, User)
self._effective_user = value
@property
def summary(self):
"""
Returns the value of the `summary` property.
"""
return self._summary
@summary.setter
def summary(self, value):
"""
Sets the value of the `summary` property.
"""
Struct._check_type('summary', value, ApiSummary)
self._summary = value
@property
def authenticated_user(self):
"""
Returns the value of the `authenticated_user` property.
"""
return self._authenticated_user
@authenticated_user.setter
def authenticated_user(self, value):
"""
Sets the value of the `authenticated_user` property.
"""
Struct._check_type('authenticated_user', value, User)
self._authenticated_user = value
@property
def time(self):
"""
Returns the value of the `time` property.
"""
return self._time
@time.setter
def time(self, value):
"""
Sets the value of the `time` property.
"""
self._time = value
@property
def product_info(self):
"""
Returns the value of the `product_info` property.
"""
return self._product_info
@product_info.setter
def product_info(self, value):
"""
Sets the value of the `product_info` property.
"""
Struct._check_type('product_info', value, ProductInfo)
self._product_info = value
@property
def special_objects(self):
"""
Returns the value of the `special_objects` property.
"""
return self._special_objects
@special_objects.setter
def special_objects(self, value):
"""
Sets the value of the `special_objects` property.
"""
Struct._check_type('special_objects', value, SpecialObjects)
self._special_objects = value
class ApiSummary(Struct):
def __init__(
self,
hosts=None,
storage_domains=None,
users=None,
vms=None,
):
super(ApiSummary, self).__init__(
)
self.hosts = hosts
self.storage_domains = storage_domains
self.users = users
self.vms = vms
@property
def users(self):
"""
Returns the value of the `users` property.
"""
return self._users
@users.setter
def users(self, value):
"""
Sets the value of the `users` property.
"""
Struct._check_type('users', value, ApiSummaryItem)
self._users = value
@property
def hosts(self):
"""
Returns the value of the `hosts` property.
"""
return self._hosts
@hosts.setter
def hosts(self, value):
"""
Sets the value of the `hosts` property.
"""
Struct._check_type('hosts', value, ApiSummaryItem)
self._hosts = value
@property
def vms(self):
"""
Returns the value of the `vms` property.
"""
return self._vms
@vms.setter
def vms(self, value):
"""
Sets the value of the `vms` property.
"""
Struct._check_type('vms', value, ApiSummaryItem)
self._vms = value
@property
def storage_domains(self):
"""
Returns the value of the `storage_domains` property.
"""
return self._storage_domains
@storage_domains.setter
def storage_domains(self, value):
"""
Sets the value of the `storage_domains` property.
"""
Struct._check_type('storage_domains', value, ApiSummaryItem)
self._storage_domains = value
class ApiSummaryItem(Struct):
def __init__(
self,
active=None,
total=None,
):
super(ApiSummaryItem, self).__init__(
)
self.active = active
self.total = total
@property
def total(self):
"""
Returns the value of the `total` property.
"""
return self._total
@total.setter
def total(self, value):
"""
Sets the value of the `total` property.
"""
self._total = value
@property
def active(self):
"""
Returns the value of the `active` property.
"""
return self._active
@active.setter
def active(self, value):
"""
Sets the value of the `active` property.
"""
self._active = value
class Bios(Struct):
def __init__(
self,
boot_menu=None,
type=None,
):
super(Bios, self).__init__(
)
self.boot_menu = boot_menu
self.type = type
@property
def boot_menu(self):
"""
Returns the value of the `boot_menu` property.
"""
return self._boot_menu
@boot_menu.setter
def boot_menu(self, value):
"""
Sets the value of the `boot_menu` property.
"""
Struct._check_type('boot_menu', value, BootMenu)
self._boot_menu = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, BiosType)
self._type = value
class BlockStatistic(Struct):
def __init__(
self,
statistics=None,
):
super(BlockStatistic, self).__init__(
)
self.statistics = statistics
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
class Bonding(Struct):
def __init__(
self,
active_slave=None,
ad_partner_mac=None,
options=None,
slaves=None,
):
super(Bonding, self).__init__(
)
self.active_slave = active_slave
self.ad_partner_mac = ad_partner_mac
self.options = options
self.slaves = slaves
@property
def active_slave(self):
"""
Returns the value of the `active_slave` property.
"""
return self._active_slave
@active_slave.setter
def active_slave(self, value):
"""
Sets the value of the `active_slave` property.
"""
Struct._check_type('active_slave', value, HostNic)
self._active_slave = value
@property
def slaves(self):
"""
Returns the value of the `slaves` property.
"""
return self._slaves
@slaves.setter
def slaves(self, value):
"""
Sets the value of the `slaves` property.
"""
self._slaves = value
@property
def ad_partner_mac(self):
"""
Returns the value of the `ad_partner_mac` property.
"""
return self._ad_partner_mac
@ad_partner_mac.setter
def ad_partner_mac(self, value):
"""
Sets the value of the `ad_partner_mac` property.
"""
Struct._check_type('ad_partner_mac', value, Mac)
self._ad_partner_mac = value
@property
def options(self):
"""
Returns the value of the `options` property.
"""
return self._options
@options.setter
def options(self, value):
"""
Sets the value of the `options` property.
"""
self._options = value
class Boot(Struct):
def __init__(
self,
devices=None,
):
super(Boot, self).__init__(
)
self.devices = devices
@property
def devices(self):
"""
Returns the value of the `devices` property.
"""
return self._devices
@devices.setter
def devices(self, value):
"""
Sets the value of the `devices` property.
"""
self._devices = value
class BootMenu(Struct):
def __init__(
self,
enabled=None,
):
super(BootMenu, self).__init__(
)
self.enabled = enabled
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class CloudInit(Struct):
def __init__(
self,
authorized_keys=None,
files=None,
host=None,
network_configuration=None,
regenerate_ssh_keys=None,
timezone=None,
users=None,
):
super(CloudInit, self).__init__(
)
self.authorized_keys = authorized_keys
self.files = files
self.host = host
self.network_configuration = network_configuration
self.regenerate_ssh_keys = regenerate_ssh_keys
self.timezone = timezone
self.users = users
@property
def users(self):
"""
Returns the value of the `users` property.
"""
return self._users
@users.setter
def users(self, value):
"""
Sets the value of the `users` property.
"""
self._users = value
@property
def network_configuration(self):
"""
Returns the value of the `network_configuration` property.
"""
return self._network_configuration
@network_configuration.setter
def network_configuration(self, value):
"""
Sets the value of the `network_configuration` property.
"""
Struct._check_type('network_configuration', value, NetworkConfiguration)
self._network_configuration = value
@property
def regenerate_ssh_keys(self):
"""
Returns the value of the `regenerate_ssh_keys` property.
"""
return self._regenerate_ssh_keys
@regenerate_ssh_keys.setter
def regenerate_ssh_keys(self, value):
"""
Sets the value of the `regenerate_ssh_keys` property.
"""
self._regenerate_ssh_keys = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def timezone(self):
"""
Returns the value of the `timezone` property.
"""
return self._timezone
@timezone.setter
def timezone(self, value):
"""
Sets the value of the `timezone` property.
"""
self._timezone = value
@property
def files(self):
"""
Returns the value of the `files` property.
"""
return self._files
@files.setter
def files(self, value):
"""
Sets the value of the `files` property.
"""
self._files = value
@property
def authorized_keys(self):
"""
Returns the value of the `authorized_keys` property.
"""
return self._authorized_keys
@authorized_keys.setter
def authorized_keys(self, value):
"""
Sets the value of the `authorized_keys` property.
"""
self._authorized_keys = value
class Configuration(Struct):
def __init__(
self,
data=None,
type=None,
):
super(Configuration, self).__init__(
)
self.data = data
self.type = type
@property
def data(self):
"""
Returns the value of the `data` property.
"""
return self._data
@data.setter
def data(self, value):
"""
Sets the value of the `data` property.
"""
self._data = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, ConfigurationType)
self._type = value
class Console(Struct):
def __init__(
self,
enabled=None,
):
super(Console, self).__init__(
)
self.enabled = enabled
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class Core(Struct):
def __init__(
self,
index=None,
socket=None,
):
super(Core, self).__init__(
)
self.index = index
self.socket = socket
@property
def index(self):
"""
Returns the value of the `index` property.
"""
return self._index
@index.setter
def index(self, value):
"""
Sets the value of the `index` property.
"""
self._index = value
@property
def socket(self):
"""
Returns the value of the `socket` property.
"""
return self._socket
@socket.setter
def socket(self, value):
"""
Sets the value of the `socket` property.
"""
self._socket = value
class Cpu(Struct):
def __init__(
self,
architecture=None,
cores=None,
cpu_tune=None,
level=None,
mode=None,
name=None,
speed=None,
topology=None,
type=None,
):
super(Cpu, self).__init__(
)
self.architecture = architecture
self.cores = cores
self.cpu_tune = cpu_tune
self.level = level
self.mode = mode
self.name = name
self.speed = speed
self.topology = topology
self.type = type
@property
def mode(self):
"""
Returns the value of the `mode` property.
"""
return self._mode
@mode.setter
def mode(self, value):
"""
Sets the value of the `mode` property.
"""
Struct._check_type('mode', value, CpuMode)
self._mode = value
@property
def level(self):
"""
Returns the value of the `level` property.
"""
return self._level
@level.setter
def level(self, value):
"""
Sets the value of the `level` property.
"""
self._level = value
@property
def cpu_tune(self):
"""
Returns the value of the `cpu_tune` property.
"""
return self._cpu_tune
@cpu_tune.setter
def cpu_tune(self, value):
"""
Sets the value of the `cpu_tune` property.
"""
Struct._check_type('cpu_tune', value, CpuTune)
self._cpu_tune = value
@property
def cores(self):
"""
Returns the value of the `cores` property.
"""
return self._cores
@cores.setter
def cores(self, value):
"""
Sets the value of the `cores` property.
"""
self._cores = value
@property
def topology(self):
"""
Returns the value of the `topology` property.
"""
return self._topology
@topology.setter
def topology(self, value):
"""
Sets the value of the `topology` property.
"""
Struct._check_type('topology', value, CpuTopology)
self._topology = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def architecture(self):
"""
Returns the value of the `architecture` property.
"""
return self._architecture
@architecture.setter
def architecture(self, value):
"""
Sets the value of the `architecture` property.
"""
Struct._check_type('architecture', value, Architecture)
self._architecture = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
@property
def speed(self):
"""
Returns the value of the `speed` property.
"""
return self._speed
@speed.setter
def speed(self, value):
"""
Sets the value of the `speed` property.
"""
self._speed = value
class CpuTopology(Struct):
def __init__(
self,
cores=None,
sockets=None,
threads=None,
):
super(CpuTopology, self).__init__(
)
self.cores = cores
self.sockets = sockets
self.threads = threads
@property
def sockets(self):
"""
Returns the value of the `sockets` property.
"""
return self._sockets
@sockets.setter
def sockets(self, value):
"""
Sets the value of the `sockets` property.
"""
self._sockets = value
@property
def cores(self):
"""
Returns the value of the `cores` property.
"""
return self._cores
@cores.setter
def cores(self, value):
"""
Sets the value of the `cores` property.
"""
self._cores = value
@property
def threads(self):
"""
Returns the value of the `threads` property.
"""
return self._threads
@threads.setter
def threads(self, value):
"""
Sets the value of the `threads` property.
"""
self._threads = value
class CpuTune(Struct):
def __init__(
self,
vcpu_pins=None,
):
super(CpuTune, self).__init__(
)
self.vcpu_pins = vcpu_pins
@property
def vcpu_pins(self):
"""
Returns the value of the `vcpu_pins` property.
"""
return self._vcpu_pins
@vcpu_pins.setter
def vcpu_pins(self, value):
"""
Sets the value of the `vcpu_pins` property.
"""
self._vcpu_pins = value
class CpuType(Struct):
def __init__(
self,
architecture=None,
level=None,
name=None,
):
super(CpuType, self).__init__(
)
self.architecture = architecture
self.level = level
self.name = name
@property
def level(self):
"""
Returns the value of the `level` property.
"""
return self._level
@level.setter
def level(self, value):
"""
Sets the value of the `level` property.
"""
self._level = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def architecture(self):
"""
Returns the value of the `architecture` property.
"""
return self._architecture
@architecture.setter
def architecture(self, value):
"""
Sets the value of the `architecture` property.
"""
Struct._check_type('architecture', value, Architecture)
self._architecture = value
class CustomProperty(Struct):
def __init__(
self,
name=None,
regexp=None,
value=None,
):
super(CustomProperty, self).__init__(
)
self.name = name
self.regexp = regexp
self.value = value
@property
def regexp(self):
"""
Returns the value of the `regexp` property.
"""
return self._regexp
@regexp.setter
def regexp(self, value):
"""
Sets the value of the `regexp` property.
"""
self._regexp = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class Display(Struct):
def __init__(
self,
address=None,
allow_override=None,
certificate=None,
copy_paste_enabled=None,
disconnect_action=None,
disconnect_action_delay=None,
file_transfer_enabled=None,
keyboard_layout=None,
monitors=None,
port=None,
proxy=None,
secure_port=None,
single_qxl_pci=None,
smartcard_enabled=None,
type=None,
):
super(Display, self).__init__(
)
self.address = address
self.allow_override = allow_override
self.certificate = certificate
self.copy_paste_enabled = copy_paste_enabled
self.disconnect_action = disconnect_action
self.disconnect_action_delay = disconnect_action_delay
self.file_transfer_enabled = file_transfer_enabled
self.keyboard_layout = keyboard_layout
self.monitors = monitors
self.port = port
self.proxy = proxy
self.secure_port = secure_port
self.single_qxl_pci = single_qxl_pci
self.smartcard_enabled = smartcard_enabled
self.type = type
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def allow_override(self):
"""
Returns the value of the `allow_override` property.
"""
return self._allow_override
@allow_override.setter
def allow_override(self, value):
"""
Sets the value of the `allow_override` property.
"""
self._allow_override = value
@property
def disconnect_action(self):
"""
Returns the value of the `disconnect_action` property.
"""
return self._disconnect_action
@disconnect_action.setter
def disconnect_action(self, value):
"""
Sets the value of the `disconnect_action` property.
"""
self._disconnect_action = value
@property
def single_qxl_pci(self):
"""
Returns the value of the `single_qxl_pci` property.
"""
return self._single_qxl_pci
@single_qxl_pci.setter
def single_qxl_pci(self, value):
"""
Sets the value of the `single_qxl_pci` property.
"""
self._single_qxl_pci = value
@property
def keyboard_layout(self):
"""
Returns the value of the `keyboard_layout` property.
"""
return self._keyboard_layout
@keyboard_layout.setter
def keyboard_layout(self, value):
"""
Sets the value of the `keyboard_layout` property.
"""
self._keyboard_layout = value
@property
def file_transfer_enabled(self):
"""
Returns the value of the `file_transfer_enabled` property.
"""
return self._file_transfer_enabled
@file_transfer_enabled.setter
def file_transfer_enabled(self, value):
"""
Sets the value of the `file_transfer_enabled` property.
"""
self._file_transfer_enabled = value
@property
def certificate(self):
"""
Returns the value of the `certificate` property.
"""
return self._certificate
@certificate.setter
def certificate(self, value):
"""
Sets the value of the `certificate` property.
"""
Struct._check_type('certificate', value, Certificate)
self._certificate = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, DisplayType)
self._type = value
@property
def secure_port(self):
"""
Returns the value of the `secure_port` property.
"""
return self._secure_port
@secure_port.setter
def secure_port(self, value):
"""
Sets the value of the `secure_port` property.
"""
self._secure_port = value
@property
def proxy(self):
"""
Returns the value of the `proxy` property.
"""
return self._proxy
@proxy.setter
def proxy(self, value):
"""
Sets the value of the `proxy` property.
"""
self._proxy = value
@property
def disconnect_action_delay(self):
"""
Returns the value of the `disconnect_action_delay` property.
"""
return self._disconnect_action_delay
@disconnect_action_delay.setter
def disconnect_action_delay(self, value):
"""
Sets the value of the `disconnect_action_delay` property.
"""
self._disconnect_action_delay = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def smartcard_enabled(self):
"""
Returns the value of the `smartcard_enabled` property.
"""
return self._smartcard_enabled
@smartcard_enabled.setter
def smartcard_enabled(self, value):
"""
Sets the value of the `smartcard_enabled` property.
"""
self._smartcard_enabled = value
@property
def monitors(self):
"""
Returns the value of the `monitors` property.
"""
return self._monitors
@monitors.setter
def monitors(self, value):
"""
Sets the value of the `monitors` property.
"""
self._monitors = value
@property
def copy_paste_enabled(self):
"""
Returns the value of the `copy_paste_enabled` property.
"""
return self._copy_paste_enabled
@copy_paste_enabled.setter
def copy_paste_enabled(self, value):
"""
Sets the value of the `copy_paste_enabled` property.
"""
self._copy_paste_enabled = value
class Dns(Struct):
def __init__(
self,
search_domains=None,
servers=None,
):
super(Dns, self).__init__(
)
self.search_domains = search_domains
self.servers = servers
@property
def search_domains(self):
"""
Returns the value of the `search_domains` property.
"""
return self._search_domains
@search_domains.setter
def search_domains(self, value):
"""
Sets the value of the `search_domains` property.
"""
self._search_domains = value
@property
def servers(self):
"""
Returns the value of the `servers` property.
"""
return self._servers
@servers.setter
def servers(self, value):
"""
Sets the value of the `servers` property.
"""
self._servers = value
class DnsResolverConfiguration(Struct):
def __init__(
self,
name_servers=None,
):
super(DnsResolverConfiguration, self).__init__(
)
self.name_servers = name_servers
@property
def name_servers(self):
"""
Returns the value of the `name_servers` property.
"""
return self._name_servers
@name_servers.setter
def name_servers(self, value):
"""
Sets the value of the `name_servers` property.
"""
self._name_servers = value
class DynamicCpu(Struct):
def __init__(
self,
cpu_tune=None,
topology=None,
):
super(DynamicCpu, self).__init__(
)
self.cpu_tune = cpu_tune
self.topology = topology
@property
def cpu_tune(self):
"""
Returns the value of the `cpu_tune` property.
"""
return self._cpu_tune
@cpu_tune.setter
def cpu_tune(self, value):
"""
Sets the value of the `cpu_tune` property.
"""
Struct._check_type('cpu_tune', value, CpuTune)
self._cpu_tune = value
@property
def topology(self):
"""
Returns the value of the `topology` property.
"""
return self._topology
@topology.setter
def topology(self, value):
"""
Sets the value of the `topology` property.
"""
Struct._check_type('topology', value, CpuTopology)
self._topology = value
class EntityProfileDetail(Struct):
def __init__(
self,
profile_details=None,
):
super(EntityProfileDetail, self).__init__(
)
self.profile_details = profile_details
@property
def profile_details(self):
"""
Returns the value of the `profile_details` property.
"""
return self._profile_details
@profile_details.setter
def profile_details(self, value):
"""
Sets the value of the `profile_details` property.
"""
self._profile_details = value
class ErrorHandling(Struct):
def __init__(
self,
on_error=None,
):
super(ErrorHandling, self).__init__(
)
self.on_error = on_error
@property
def on_error(self):
"""
Returns the value of the `on_error` property.
"""
return self._on_error
@on_error.setter
def on_error(self, value):
"""
Sets the value of the `on_error` property.
"""
Struct._check_type('on_error', value, MigrateOnError)
self._on_error = value
class ExternalTemplateImport(Struct):
def __init__(
self,
clone=None,
cluster=None,
cpu_profile=None,
host=None,
quota=None,
storage_domain=None,
template=None,
url=None,
):
super(ExternalTemplateImport, self).__init__(
)
self.clone = clone
self.cluster = cluster
self.cpu_profile = cpu_profile
self.host = host
self.quota = quota
self.storage_domain = storage_domain
self.template = template
self.url = url
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def quota(self):
"""
Returns the value of the `quota` property.
"""
return self._quota
@quota.setter
def quota(self, value):
"""
Sets the value of the `quota` property.
"""
Struct._check_type('quota', value, Quota)
self._quota = value
@property
def clone(self):
"""
Returns the value of the `clone` property.
"""
return self._clone
@clone.setter
def clone(self, value):
"""
Sets the value of the `clone` property.
"""
self._clone = value
@property
def url(self):
"""
Returns the value of the `url` property.
"""
return self._url
@url.setter
def url(self, value):
"""
Sets the value of the `url` property.
"""
self._url = value
@property
def cpu_profile(self):
"""
Returns the value of the `cpu_profile` property.
"""
return self._cpu_profile
@cpu_profile.setter
def cpu_profile(self, value):
"""
Sets the value of the `cpu_profile` property.
"""
Struct._check_type('cpu_profile', value, CpuProfile)
self._cpu_profile = value
class ExternalVmImport(Struct):
def __init__(
self,
cluster=None,
cpu_profile=None,
drivers_iso=None,
host=None,
name=None,
password=None,
provider=None,
quota=None,
sparse=None,
storage_domain=None,
url=None,
username=None,
vm=None,
):
super(ExternalVmImport, self).__init__(
)
self.cluster = cluster
self.cpu_profile = cpu_profile
self.drivers_iso = drivers_iso
self.host = host
self.name = name
self.password = password
self.provider = provider
self.quota = quota
self.sparse = sparse
self.storage_domain = storage_domain
self.url = url
self.username = username
self.vm = vm
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def drivers_iso(self):
"""
Returns the value of the `drivers_iso` property.
"""
return self._drivers_iso
@drivers_iso.setter
def drivers_iso(self, value):
"""
Sets the value of the `drivers_iso` property.
"""
Struct._check_type('drivers_iso', value, File)
self._drivers_iso = value
@property
def sparse(self):
"""
Returns the value of the `sparse` property.
"""
return self._sparse
@sparse.setter
def sparse(self, value):
"""
Sets the value of the `sparse` property.
"""
self._sparse = value
@property
def url(self):
"""
Returns the value of the `url` property.
"""
return self._url
@url.setter
def url(self, value):
"""
Sets the value of the `url` property.
"""
self._url = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def provider(self):
"""
Returns the value of the `provider` property.
"""
return self._provider
@provider.setter
def provider(self, value):
"""
Sets the value of the `provider` property.
"""
Struct._check_type('provider', value, ExternalVmProviderType)
self._provider = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def quota(self):
"""
Returns the value of the `quota` property.
"""
return self._quota
@quota.setter
def quota(self, value):
"""
Sets the value of the `quota` property.
"""
Struct._check_type('quota', value, Quota)
self._quota = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def cpu_profile(self):
"""
Returns the value of the `cpu_profile` property.
"""
return self._cpu_profile
@cpu_profile.setter
def cpu_profile(self, value):
"""
Sets the value of the `cpu_profile` property.
"""
Struct._check_type('cpu_profile', value, CpuProfile)
self._cpu_profile = value
class Fault(Struct):
def __init__(
self,
detail=None,
reason=None,
):
super(Fault, self).__init__(
)
self.detail = detail
self.reason = reason
@property
def reason(self):
"""
Returns the value of the `reason` property.
"""
return self._reason
@reason.setter
def reason(self, value):
"""
Sets the value of the `reason` property.
"""
self._reason = value
@property
def detail(self):
"""
Returns the value of the `detail` property.
"""
return self._detail
@detail.setter
def detail(self, value):
"""
Sets the value of the `detail` property.
"""
self._detail = value
class FencingPolicy(Struct):
def __init__(
self,
enabled=None,
skip_if_connectivity_broken=None,
skip_if_gluster_bricks_up=None,
skip_if_gluster_quorum_not_met=None,
skip_if_sd_active=None,
):
super(FencingPolicy, self).__init__(
)
self.enabled = enabled
self.skip_if_connectivity_broken = skip_if_connectivity_broken
self.skip_if_gluster_bricks_up = skip_if_gluster_bricks_up
self.skip_if_gluster_quorum_not_met = skip_if_gluster_quorum_not_met
self.skip_if_sd_active = skip_if_sd_active
@property
def skip_if_connectivity_broken(self):
"""
Returns the value of the `skip_if_connectivity_broken` property.
"""
return self._skip_if_connectivity_broken
@skip_if_connectivity_broken.setter
def skip_if_connectivity_broken(self, value):
"""
Sets the value of the `skip_if_connectivity_broken` property.
"""
Struct._check_type('skip_if_connectivity_broken', value, SkipIfConnectivityBroken)
self._skip_if_connectivity_broken = value
@property
def skip_if_gluster_quorum_not_met(self):
"""
Returns the value of the `skip_if_gluster_quorum_not_met` property.
"""
return self._skip_if_gluster_quorum_not_met
@skip_if_gluster_quorum_not_met.setter
def skip_if_gluster_quorum_not_met(self, value):
"""
Sets the value of the `skip_if_gluster_quorum_not_met` property.
"""
self._skip_if_gluster_quorum_not_met = value
@property
def skip_if_sd_active(self):
"""
Returns the value of the `skip_if_sd_active` property.
"""
return self._skip_if_sd_active
@skip_if_sd_active.setter
def skip_if_sd_active(self, value):
"""
Sets the value of the `skip_if_sd_active` property.
"""
Struct._check_type('skip_if_sd_active', value, SkipIfSdActive)
self._skip_if_sd_active = value
@property
def skip_if_gluster_bricks_up(self):
"""
Returns the value of the `skip_if_gluster_bricks_up` property.
"""
return self._skip_if_gluster_bricks_up
@skip_if_gluster_bricks_up.setter
def skip_if_gluster_bricks_up(self, value):
"""
Sets the value of the `skip_if_gluster_bricks_up` property.
"""
self._skip_if_gluster_bricks_up = value
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class FopStatistic(Struct):
def __init__(
self,
name=None,
statistics=None,
):
super(FopStatistic, self).__init__(
)
self.name = name
self.statistics = statistics
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
class GlusterBrickMemoryInfo(Struct):
def __init__(
self,
memory_pools=None,
):
super(GlusterBrickMemoryInfo, self).__init__(
)
self.memory_pools = memory_pools
@property
def memory_pools(self):
"""
Returns the value of the `memory_pools` property.
"""
return self._memory_pools
@memory_pools.setter
def memory_pools(self, value):
"""
Sets the value of the `memory_pools` property.
"""
self._memory_pools = value
class GlusterClient(Struct):
def __init__(
self,
bytes_read=None,
bytes_written=None,
client_port=None,
host_name=None,
):
super(GlusterClient, self).__init__(
)
self.bytes_read = bytes_read
self.bytes_written = bytes_written
self.client_port = client_port
self.host_name = host_name
@property
def bytes_read(self):
"""
Returns the value of the `bytes_read` property.
"""
return self._bytes_read
@bytes_read.setter
def bytes_read(self, value):
"""
Sets the value of the `bytes_read` property.
"""
self._bytes_read = value
@property
def host_name(self):
"""
Returns the value of the `host_name` property.
"""
return self._host_name
@host_name.setter
def host_name(self, value):
"""
Sets the value of the `host_name` property.
"""
self._host_name = value
@property
def client_port(self):
"""
Returns the value of the `client_port` property.
"""
return self._client_port
@client_port.setter
def client_port(self, value):
"""
Sets the value of the `client_port` property.
"""
self._client_port = value
@property
def bytes_written(self):
"""
Returns the value of the `bytes_written` property.
"""
return self._bytes_written
@bytes_written.setter
def bytes_written(self, value):
"""
Sets the value of the `bytes_written` property.
"""
self._bytes_written = value
class GracePeriod(Struct):
def __init__(
self,
expiry=None,
):
super(GracePeriod, self).__init__(
)
self.expiry = expiry
@property
def expiry(self):
"""
Returns the value of the `expiry` property.
"""
return self._expiry
@expiry.setter
def expiry(self, value):
"""
Sets the value of the `expiry` property.
"""
self._expiry = value
class GuestOperatingSystem(Struct):
def __init__(
self,
architecture=None,
codename=None,
distribution=None,
family=None,
kernel=None,
version=None,
):
super(GuestOperatingSystem, self).__init__(
)
self.architecture = architecture
self.codename = codename
self.distribution = distribution
self.family = family
self.kernel = kernel
self.version = version
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
@property
def kernel(self):
"""
Returns the value of the `kernel` property.
"""
return self._kernel
@kernel.setter
def kernel(self, value):
"""
Sets the value of the `kernel` property.
"""
Struct._check_type('kernel', value, Kernel)
self._kernel = value
@property
def codename(self):
"""
Returns the value of the `codename` property.
"""
return self._codename
@codename.setter
def codename(self, value):
"""
Sets the value of the `codename` property.
"""
self._codename = value
@property
def distribution(self):
"""
Returns the value of the `distribution` property.
"""
return self._distribution
@distribution.setter
def distribution(self, value):
"""
Sets the value of the `distribution` property.
"""
self._distribution = value
@property
def family(self):
"""
Returns the value of the `family` property.
"""
return self._family
@family.setter
def family(self, value):
"""
Sets the value of the `family` property.
"""
self._family = value
@property
def architecture(self):
"""
Returns the value of the `architecture` property.
"""
return self._architecture
@architecture.setter
def architecture(self, value):
"""
Sets the value of the `architecture` property.
"""
self._architecture = value
class HardwareInformation(Struct):
def __init__(
self,
family=None,
manufacturer=None,
product_name=None,
serial_number=None,
supported_rng_sources=None,
uuid=None,
version=None,
):
super(HardwareInformation, self).__init__(
)
self.family = family
self.manufacturer = manufacturer
self.product_name = product_name
self.serial_number = serial_number
self.supported_rng_sources = supported_rng_sources
self.uuid = uuid
self.version = version
@property
def serial_number(self):
"""
Returns the value of the `serial_number` property.
"""
return self._serial_number
@serial_number.setter
def serial_number(self, value):
"""
Sets the value of the `serial_number` property.
"""
self._serial_number = value
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
self._version = value
@property
def product_name(self):
"""
Returns the value of the `product_name` property.
"""
return self._product_name
@product_name.setter
def product_name(self, value):
"""
Sets the value of the `product_name` property.
"""
self._product_name = value
@property
def family(self):
"""
Returns the value of the `family` property.
"""
return self._family
@family.setter
def family(self, value):
"""
Sets the value of the `family` property.
"""
self._family = value
@property
def supported_rng_sources(self):
"""
Returns the value of the `supported_rng_sources` property.
"""
return self._supported_rng_sources
@supported_rng_sources.setter
def supported_rng_sources(self, value):
"""
Sets the value of the `supported_rng_sources` property.
"""
self._supported_rng_sources = value
@property
def uuid(self):
"""
Returns the value of the `uuid` property.
"""
return self._uuid
@uuid.setter
def uuid(self, value):
"""
Sets the value of the `uuid` property.
"""
self._uuid = value
@property
def manufacturer(self):
"""
Returns the value of the `manufacturer` property.
"""
return self._manufacturer
@manufacturer.setter
def manufacturer(self, value):
"""
Sets the value of the `manufacturer` property.
"""
self._manufacturer = value
class HighAvailability(Struct):
def __init__(
self,
enabled=None,
priority=None,
):
super(HighAvailability, self).__init__(
)
self.enabled = enabled
self.priority = priority
@property
def priority(self):
"""
Returns the value of the `priority` property.
"""
return self._priority
@priority.setter
def priority(self, value):
"""
Sets the value of the `priority` property.
"""
self._priority = value
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class HostDevicePassthrough(Struct):
def __init__(
self,
enabled=None,
):
super(HostDevicePassthrough, self).__init__(
)
self.enabled = enabled
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class HostNicVirtualFunctionsConfiguration(Struct):
def __init__(
self,
all_networks_allowed=None,
max_number_of_virtual_functions=None,
number_of_virtual_functions=None,
):
super(HostNicVirtualFunctionsConfiguration, self).__init__(
)
self.all_networks_allowed = all_networks_allowed
self.max_number_of_virtual_functions = max_number_of_virtual_functions
self.number_of_virtual_functions = number_of_virtual_functions
@property
def max_number_of_virtual_functions(self):
"""
Returns the value of the `max_number_of_virtual_functions` property.
"""
return self._max_number_of_virtual_functions
@max_number_of_virtual_functions.setter
def max_number_of_virtual_functions(self, value):
"""
Sets the value of the `max_number_of_virtual_functions` property.
"""
self._max_number_of_virtual_functions = value
@property
def all_networks_allowed(self):
"""
Returns the value of the `all_networks_allowed` property.
"""
return self._all_networks_allowed
@all_networks_allowed.setter
def all_networks_allowed(self, value):
"""
Sets the value of the `all_networks_allowed` property.
"""
self._all_networks_allowed = value
@property
def number_of_virtual_functions(self):
"""
Returns the value of the `number_of_virtual_functions` property.
"""
return self._number_of_virtual_functions
@number_of_virtual_functions.setter
def number_of_virtual_functions(self, value):
"""
Sets the value of the `number_of_virtual_functions` property.
"""
self._number_of_virtual_functions = value
class HostedEngine(Struct):
def __init__(
self,
active=None,
configured=None,
global_maintenance=None,
local_maintenance=None,
score=None,
):
super(HostedEngine, self).__init__(
)
self.active = active
self.configured = configured
self.global_maintenance = global_maintenance
self.local_maintenance = local_maintenance
self.score = score
@property
def score(self):
"""
Returns the value of the `score` property.
"""
return self._score
@score.setter
def score(self, value):
"""
Sets the value of the `score` property.
"""
self._score = value
@property
def configured(self):
"""
Returns the value of the `configured` property.
"""
return self._configured
@configured.setter
def configured(self, value):
"""
Sets the value of the `configured` property.
"""
self._configured = value
@property
def global_maintenance(self):
"""
Returns the value of the `global_maintenance` property.
"""
return self._global_maintenance
@global_maintenance.setter
def global_maintenance(self, value):
"""
Sets the value of the `global_maintenance` property.
"""
self._global_maintenance = value
@property
def active(self):
"""
Returns the value of the `active` property.
"""
return self._active
@active.setter
def active(self, value):
"""
Sets the value of the `active` property.
"""
self._active = value
@property
def local_maintenance(self):
"""
Returns the value of the `local_maintenance` property.
"""
return self._local_maintenance
@local_maintenance.setter
def local_maintenance(self, value):
"""
Sets the value of the `local_maintenance` property.
"""
self._local_maintenance = value
class Identified(Struct):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
):
super(Identified, self).__init__(
)
self.comment = comment
self.description = description
self.id = id
self.name = name
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def id(self):
"""
Returns the value of the `id` property.
"""
return self._id
@id.setter
def id(self, value):
"""
Sets the value of the `id` property.
"""
self._id = value
@property
def comment(self):
"""
Returns the value of the `comment` property.
"""
return self._comment
@comment.setter
def comment(self, value):
"""
Sets the value of the `comment` property.
"""
self._comment = value
@property
def description(self):
"""
Returns the value of the `description` property.
"""
return self._description
@description.setter
def description(self, value):
"""
Sets the value of the `description` property.
"""
self._description = value
class Image(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
size=None,
storage_domain=None,
type=None,
):
super(Image, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.size = size
self.storage_domain = storage_domain
self.type = type
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def size(self):
"""
Returns the value of the `size` property.
"""
return self._size
@size.setter
def size(self, value):
"""
Sets the value of the `size` property.
"""
self._size = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, ImageFileType)
self._type = value
class ImageTransfer(Identified):
def __init__(
self,
active=None,
backup=None,
comment=None,
description=None,
direction=None,
disk=None,
format=None,
host=None,
id=None,
image=None,
inactivity_timeout=None,
name=None,
phase=None,
proxy_url=None,
shallow=None,
snapshot=None,
timeout_policy=None,
transfer_url=None,
transferred=None,
):
super(ImageTransfer, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.active = active
self.backup = backup
self.direction = direction
self.disk = disk
self.format = format
self.host = host
self.image = image
self.inactivity_timeout = inactivity_timeout
self.phase = phase
self.proxy_url = proxy_url
self.shallow = shallow
self.snapshot = snapshot
self.timeout_policy = timeout_policy
self.transfer_url = transfer_url
self.transferred = transferred
@property
def image(self):
"""
Returns the value of the `image` property.
"""
return self._image
@image.setter
def image(self, value):
"""
Sets the value of the `image` property.
"""
Struct._check_type('image', value, Image)
self._image = value
@property
def phase(self):
"""
Returns the value of the `phase` property.
"""
return self._phase
@phase.setter
def phase(self, value):
"""
Sets the value of the `phase` property.
"""
Struct._check_type('phase', value, ImageTransferPhase)
self._phase = value
@property
def transferred(self):
"""
Returns the value of the `transferred` property.
"""
return self._transferred
@transferred.setter
def transferred(self, value):
"""
Sets the value of the `transferred` property.
"""
self._transferred = value
@property
def backup(self):
"""
Returns the value of the `backup` property.
"""
return self._backup
@backup.setter
def backup(self, value):
"""
Sets the value of the `backup` property.
"""
Struct._check_type('backup', value, Backup)
self._backup = value
@property
def transfer_url(self):
"""
Returns the value of the `transfer_url` property.
"""
return self._transfer_url
@transfer_url.setter
def transfer_url(self, value):
"""
Sets the value of the `transfer_url` property.
"""
self._transfer_url = value
@property
def format(self):
"""
Returns the value of the `format` property.
"""
return self._format
@format.setter
def format(self, value):
"""
Sets the value of the `format` property.
"""
Struct._check_type('format', value, DiskFormat)
self._format = value
@property
def active(self):
"""
Returns the value of the `active` property.
"""
return self._active
@active.setter
def active(self, value):
"""
Sets the value of the `active` property.
"""
self._active = value
@property
def inactivity_timeout(self):
"""
Returns the value of the `inactivity_timeout` property.
"""
return self._inactivity_timeout
@inactivity_timeout.setter
def inactivity_timeout(self, value):
"""
Sets the value of the `inactivity_timeout` property.
"""
self._inactivity_timeout = value
@property
def disk(self):
"""
Returns the value of the `disk` property.
"""
return self._disk
@disk.setter
def disk(self, value):
"""
Sets the value of the `disk` property.
"""
Struct._check_type('disk', value, Disk)
self._disk = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def proxy_url(self):
"""
Returns the value of the `proxy_url` property.
"""
return self._proxy_url
@proxy_url.setter
def proxy_url(self, value):
"""
Sets the value of the `proxy_url` property.
"""
self._proxy_url = value
@property
def snapshot(self):
"""
Returns the value of the `snapshot` property.
"""
return self._snapshot
@snapshot.setter
def snapshot(self, value):
"""
Sets the value of the `snapshot` property.
"""
Struct._check_type('snapshot', value, DiskSnapshot)
self._snapshot = value
@property
def timeout_policy(self):
"""
Returns the value of the `timeout_policy` property.
"""
return self._timeout_policy
@timeout_policy.setter
def timeout_policy(self, value):
"""
Sets the value of the `timeout_policy` property.
"""
Struct._check_type('timeout_policy', value, ImageTransferTimeoutPolicy)
self._timeout_policy = value
@property
def shallow(self):
"""
Returns the value of the `shallow` property.
"""
return self._shallow
@shallow.setter
def shallow(self, value):
"""
Sets the value of the `shallow` property.
"""
self._shallow = value
@property
def direction(self):
"""
Returns the value of the `direction` property.
"""
return self._direction
@direction.setter
def direction(self, value):
"""
Sets the value of the `direction` property.
"""
Struct._check_type('direction', value, ImageTransferDirection)
self._direction = value
class Initialization(Struct):
def __init__(
self,
active_directory_ou=None,
authorized_ssh_keys=None,
cloud_init=None,
cloud_init_network_protocol=None,
configuration=None,
custom_script=None,
dns_search=None,
dns_servers=None,
domain=None,
host_name=None,
input_locale=None,
nic_configurations=None,
org_name=None,
regenerate_ids=None,
regenerate_ssh_keys=None,
root_password=None,
system_locale=None,
timezone=None,
ui_language=None,
user_locale=None,
user_name=None,
windows_license_key=None,
):
super(Initialization, self).__init__(
)
self.active_directory_ou = active_directory_ou
self.authorized_ssh_keys = authorized_ssh_keys
self.cloud_init = cloud_init
self.cloud_init_network_protocol = cloud_init_network_protocol
self.configuration = configuration
self.custom_script = custom_script
self.dns_search = dns_search
self.dns_servers = dns_servers
self.domain = domain
self.host_name = host_name
self.input_locale = input_locale
self.nic_configurations = nic_configurations
self.org_name = org_name
self.regenerate_ids = regenerate_ids
self.regenerate_ssh_keys = regenerate_ssh_keys
self.root_password = root_password
self.system_locale = system_locale
self.timezone = timezone
self.ui_language = ui_language
self.user_locale = user_locale
self.user_name = user_name
self.windows_license_key = windows_license_key
@property
def regenerate_ssh_keys(self):
"""
Returns the value of the `regenerate_ssh_keys` property.
"""
return self._regenerate_ssh_keys
@regenerate_ssh_keys.setter
def regenerate_ssh_keys(self, value):
"""
Sets the value of the `regenerate_ssh_keys` property.
"""
self._regenerate_ssh_keys = value
@property
def host_name(self):
"""
Returns the value of the `host_name` property.
"""
return self._host_name
@host_name.setter
def host_name(self, value):
"""
Sets the value of the `host_name` property.
"""
self._host_name = value
@property
def configuration(self):
"""
Returns the value of the `configuration` property.
"""
return self._configuration
@configuration.setter
def configuration(self, value):
"""
Sets the value of the `configuration` property.
"""
Struct._check_type('configuration', value, Configuration)
self._configuration = value
@property
def timezone(self):
"""
Returns the value of the `timezone` property.
"""
return self._timezone
@timezone.setter
def timezone(self, value):
"""
Sets the value of the `timezone` property.
"""
self._timezone = value
@property
def authorized_ssh_keys(self):
"""
Returns the value of the `authorized_ssh_keys` property.
"""
return self._authorized_ssh_keys
@authorized_ssh_keys.setter
def authorized_ssh_keys(self, value):
"""
Sets the value of the `authorized_ssh_keys` property.
"""
self._authorized_ssh_keys = value
@property
def dns_search(self):
"""
Returns the value of the `dns_search` property.
"""
return self._dns_search
@dns_search.setter
def dns_search(self, value):
"""
Sets the value of the `dns_search` property.
"""
self._dns_search = value
@property
def cloud_init_network_protocol(self):
"""
Returns the value of the `cloud_init_network_protocol` property.
"""
return self._cloud_init_network_protocol
@cloud_init_network_protocol.setter
def cloud_init_network_protocol(self, value):
"""
Sets the value of the `cloud_init_network_protocol` property.
"""
Struct._check_type('cloud_init_network_protocol', value, CloudInitNetworkProtocol)
self._cloud_init_network_protocol = value
@property
def system_locale(self):
"""
Returns the value of the `system_locale` property.
"""
return self._system_locale
@system_locale.setter
def system_locale(self, value):
"""
Sets the value of the `system_locale` property.
"""
self._system_locale = value
@property
def user_locale(self):
"""
Returns the value of the `user_locale` property.
"""
return self._user_locale
@user_locale.setter
def user_locale(self, value):
"""
Sets the value of the `user_locale` property.
"""
self._user_locale = value
@property
def active_directory_ou(self):
"""
Returns the value of the `active_directory_ou` property.
"""
return self._active_directory_ou
@active_directory_ou.setter
def active_directory_ou(self, value):
"""
Sets the value of the `active_directory_ou` property.
"""
self._active_directory_ou = value
@property
def org_name(self):
"""
Returns the value of the `org_name` property.
"""
return self._org_name
@org_name.setter
def org_name(self, value):
"""
Sets the value of the `org_name` property.
"""
self._org_name = value
@property
def domain(self):
"""
Returns the value of the `domain` property.
"""
return self._domain
@domain.setter
def domain(self, value):
"""
Sets the value of the `domain` property.
"""
self._domain = value
@property
def ui_language(self):
"""
Returns the value of the `ui_language` property.
"""
return self._ui_language
@ui_language.setter
def ui_language(self, value):
"""
Sets the value of the `ui_language` property.
"""
self._ui_language = value
@property
def windows_license_key(self):
"""
Returns the value of the `windows_license_key` property.
"""
return self._windows_license_key
@windows_license_key.setter
def windows_license_key(self, value):
"""
Sets the value of the `windows_license_key` property.
"""
self._windows_license_key = value
@property
def input_locale(self):
"""
Returns the value of the `input_locale` property.
"""
return self._input_locale
@input_locale.setter
def input_locale(self, value):
"""
Sets the value of the `input_locale` property.
"""
self._input_locale = value
@property
def nic_configurations(self):
"""
Returns the value of the `nic_configurations` property.
"""
return self._nic_configurations
@nic_configurations.setter
def nic_configurations(self, value):
"""
Sets the value of the `nic_configurations` property.
"""
self._nic_configurations = value
@property
def dns_servers(self):
"""
Returns the value of the `dns_servers` property.
"""
return self._dns_servers
@dns_servers.setter
def dns_servers(self, value):
"""
Sets the value of the `dns_servers` property.
"""
self._dns_servers = value
@property
def cloud_init(self):
"""
Returns the value of the `cloud_init` property.
"""
return self._cloud_init
@cloud_init.setter
def cloud_init(self, value):
"""
Sets the value of the `cloud_init` property.
"""
Struct._check_type('cloud_init', value, CloudInit)
self._cloud_init = value
@property
def custom_script(self):
"""
Returns the value of the `custom_script` property.
"""
return self._custom_script
@custom_script.setter
def custom_script(self, value):
"""
Sets the value of the `custom_script` property.
"""
self._custom_script = value
@property
def user_name(self):
"""
Returns the value of the `user_name` property.
"""
return self._user_name
@user_name.setter
def user_name(self, value):
"""
Sets the value of the `user_name` property.
"""
self._user_name = value
@property
def regenerate_ids(self):
"""
Returns the value of the `regenerate_ids` property.
"""
return self._regenerate_ids
@regenerate_ids.setter
def regenerate_ids(self, value):
"""
Sets the value of the `regenerate_ids` property.
"""
self._regenerate_ids = value
@property
def root_password(self):
"""
Returns the value of the `root_password` property.
"""
return self._root_password
@root_password.setter
def root_password(self, value):
"""
Sets the value of the `root_password` property.
"""
self._root_password = value
class Io(Struct):
def __init__(
self,
threads=None,
):
super(Io, self).__init__(
)
self.threads = threads
@property
def threads(self):
"""
Returns the value of the `threads` property.
"""
return self._threads
@threads.setter
def threads(self, value):
"""
Sets the value of the `threads` property.
"""
self._threads = value
class Ip(Struct):
def __init__(
self,
address=None,
gateway=None,
netmask=None,
version=None,
):
super(Ip, self).__init__(
)
self.address = address
self.gateway = gateway
self.netmask = netmask
self.version = version
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, IpVersion)
self._version = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def netmask(self):
"""
Returns the value of the `netmask` property.
"""
return self._netmask
@netmask.setter
def netmask(self, value):
"""
Sets the value of the `netmask` property.
"""
self._netmask = value
@property
def gateway(self):
"""
Returns the value of the `gateway` property.
"""
return self._gateway
@gateway.setter
def gateway(self, value):
"""
Sets the value of the `gateway` property.
"""
self._gateway = value
class IpAddressAssignment(Struct):
def __init__(
self,
assignment_method=None,
ip=None,
):
super(IpAddressAssignment, self).__init__(
)
self.assignment_method = assignment_method
self.ip = ip
@property
def ip(self):
"""
Returns the value of the `ip` property.
"""
return self._ip
@ip.setter
def ip(self, value):
"""
Sets the value of the `ip` property.
"""
Struct._check_type('ip', value, Ip)
self._ip = value
@property
def assignment_method(self):
"""
Returns the value of the `assignment_method` property.
"""
return self._assignment_method
@assignment_method.setter
def assignment_method(self, value):
"""
Sets the value of the `assignment_method` property.
"""
Struct._check_type('assignment_method', value, BootProtocol)
self._assignment_method = value
class IscsiBond(Identified):
def __init__(
self,
comment=None,
data_center=None,
description=None,
id=None,
name=None,
networks=None,
storage_connections=None,
):
super(IscsiBond, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.data_center = data_center
self.networks = networks
self.storage_connections = storage_connections
@property
def storage_connections(self):
"""
Returns the value of the `storage_connections` property.
"""
return self._storage_connections
@storage_connections.setter
def storage_connections(self, value):
"""
Sets the value of the `storage_connections` property.
"""
self._storage_connections = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def networks(self):
"""
Returns the value of the `networks` property.
"""
return self._networks
@networks.setter
def networks(self, value):
"""
Sets the value of the `networks` property.
"""
self._networks = value
class IscsiDetails(Struct):
def __init__(
self,
address=None,
disk_id=None,
initiator=None,
lun_mapping=None,
password=None,
paths=None,
port=None,
portal=None,
product_id=None,
serial=None,
size=None,
status=None,
storage_domain_id=None,
target=None,
username=None,
vendor_id=None,
volume_group_id=None,
):
super(IscsiDetails, self).__init__(
)
self.address = address
self.disk_id = disk_id
self.initiator = initiator
self.lun_mapping = lun_mapping
self.password = password
self.paths = paths
self.port = port
self.portal = portal
self.product_id = product_id
self.serial = serial
self.size = size
self.status = status
self.storage_domain_id = storage_domain_id
self.target = target
self.username = username
self.vendor_id = vendor_id
self.volume_group_id = volume_group_id
@property
def storage_domain_id(self):
"""
Returns the value of the `storage_domain_id` property.
"""
return self._storage_domain_id
@storage_domain_id.setter
def storage_domain_id(self, value):
"""
Sets the value of the `storage_domain_id` property.
"""
self._storage_domain_id = value
@property
def vendor_id(self):
"""
Returns the value of the `vendor_id` property.
"""
return self._vendor_id
@vendor_id.setter
def vendor_id(self, value):
"""
Sets the value of the `vendor_id` property.
"""
self._vendor_id = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def initiator(self):
"""
Returns the value of the `initiator` property.
"""
return self._initiator
@initiator.setter
def initiator(self, value):
"""
Sets the value of the `initiator` property.
"""
self._initiator = value
@property
def product_id(self):
"""
Returns the value of the `product_id` property.
"""
return self._product_id
@product_id.setter
def product_id(self, value):
"""
Sets the value of the `product_id` property.
"""
self._product_id = value
@property
def disk_id(self):
"""
Returns the value of the `disk_id` property.
"""
return self._disk_id
@disk_id.setter
def disk_id(self, value):
"""
Sets the value of the `disk_id` property.
"""
self._disk_id = value
@property
def target(self):
"""
Returns the value of the `target` property.
"""
return self._target
@target.setter
def target(self, value):
"""
Sets the value of the `target` property.
"""
self._target = value
@property
def serial(self):
"""
Returns the value of the `serial` property.
"""
return self._serial
@serial.setter
def serial(self, value):
"""
Sets the value of the `serial` property.
"""
self._serial = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def lun_mapping(self):
"""
Returns the value of the `lun_mapping` property.
"""
return self._lun_mapping
@lun_mapping.setter
def lun_mapping(self, value):
"""
Sets the value of the `lun_mapping` property.
"""
self._lun_mapping = value
@property
def size(self):
"""
Returns the value of the `size` property.
"""
return self._size
@size.setter
def size(self, value):
"""
Sets the value of the `size` property.
"""
self._size = value
@property
def paths(self):
"""
Returns the value of the `paths` property.
"""
return self._paths
@paths.setter
def paths(self, value):
"""
Sets the value of the `paths` property.
"""
self._paths = value
@property
def portal(self):
"""
Returns the value of the `portal` property.
"""
return self._portal
@portal.setter
def portal(self, value):
"""
Sets the value of the `portal` property.
"""
self._portal = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
self._status = value
@property
def volume_group_id(self):
"""
Returns the value of the `volume_group_id` property.
"""
return self._volume_group_id
@volume_group_id.setter
def volume_group_id(self, value):
"""
Sets the value of the `volume_group_id` property.
"""
self._volume_group_id = value
class Job(Identified):
def __init__(
self,
auto_cleared=None,
comment=None,
description=None,
end_time=None,
external=None,
id=None,
last_updated=None,
name=None,
owner=None,
start_time=None,
status=None,
steps=None,
):
super(Job, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.auto_cleared = auto_cleared
self.end_time = end_time
self.external = external
self.last_updated = last_updated
self.owner = owner
self.start_time = start_time
self.status = status
self.steps = steps
@property
def last_updated(self):
"""
Returns the value of the `last_updated` property.
"""
return self._last_updated
@last_updated.setter
def last_updated(self, value):
"""
Sets the value of the `last_updated` property.
"""
self._last_updated = value
@property
def auto_cleared(self):
"""
Returns the value of the `auto_cleared` property.
"""
return self._auto_cleared
@auto_cleared.setter
def auto_cleared(self, value):
"""
Sets the value of the `auto_cleared` property.
"""
self._auto_cleared = value
@property
def owner(self):
"""
Returns the value of the `owner` property.
"""
return self._owner
@owner.setter
def owner(self, value):
"""
Sets the value of the `owner` property.
"""
Struct._check_type('owner', value, User)
self._owner = value
@property
def external(self):
"""
Returns the value of the `external` property.
"""
return self._external
@external.setter
def external(self, value):
"""
Sets the value of the `external` property.
"""
self._external = value
@property
def end_time(self):
"""
Returns the value of the `end_time` property.
"""
return self._end_time
@end_time.setter
def end_time(self, value):
"""
Sets the value of the `end_time` property.
"""
self._end_time = value
@property
def start_time(self):
"""
Returns the value of the `start_time` property.
"""
return self._start_time
@start_time.setter
def start_time(self, value):
"""
Sets the value of the `start_time` property.
"""
self._start_time = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, JobStatus)
self._status = value
@property
def steps(self):
"""
Returns the value of the `steps` property.
"""
return self._steps
@steps.setter
def steps(self, value):
"""
Sets the value of the `steps` property.
"""
self._steps = value
class KatelloErratum(Identified):
def __init__(
self,
comment=None,
description=None,
host=None,
id=None,
issued=None,
name=None,
packages=None,
severity=None,
solution=None,
summary=None,
title=None,
type=None,
vm=None,
):
super(KatelloErratum, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.host = host
self.issued = issued
self.packages = packages
self.severity = severity
self.solution = solution
self.summary = summary
self.title = title
self.type = type
self.vm = vm
@property
def severity(self):
"""
Returns the value of the `severity` property.
"""
return self._severity
@severity.setter
def severity(self, value):
"""
Sets the value of the `severity` property.
"""
self._severity = value
@property
def title(self):
"""
Returns the value of the `title` property.
"""
return self._title
@title.setter
def title(self, value):
"""
Sets the value of the `title` property.
"""
self._title = value
@property
def summary(self):
"""
Returns the value of the `summary` property.
"""
return self._summary
@summary.setter
def summary(self, value):
"""
Sets the value of the `summary` property.
"""
self._summary = value
@property
def solution(self):
"""
Returns the value of the `solution` property.
"""
return self._solution
@solution.setter
def solution(self, value):
"""
Sets the value of the `solution` property.
"""
self._solution = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def issued(self):
"""
Returns the value of the `issued` property.
"""
return self._issued
@issued.setter
def issued(self, value):
"""
Sets the value of the `issued` property.
"""
self._issued = value
@property
def packages(self):
"""
Returns the value of the `packages` property.
"""
return self._packages
@packages.setter
def packages(self, value):
"""
Sets the value of the `packages` property.
"""
self._packages = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
class Kernel(Struct):
def __init__(
self,
version=None,
):
super(Kernel, self).__init__(
)
self.version = version
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
class Ksm(Struct):
def __init__(
self,
enabled=None,
merge_across_nodes=None,
):
super(Ksm, self).__init__(
)
self.enabled = enabled
self.merge_across_nodes = merge_across_nodes
@property
def merge_across_nodes(self):
"""
Returns the value of the `merge_across_nodes` property.
"""
return self._merge_across_nodes
@merge_across_nodes.setter
def merge_across_nodes(self, value):
"""
Sets the value of the `merge_across_nodes` property.
"""
self._merge_across_nodes = value
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class LinkLayerDiscoveryProtocolElement(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
oui=None,
properties=None,
subtype=None,
type=None,
):
super(LinkLayerDiscoveryProtocolElement, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.oui = oui
self.properties = properties
self.subtype = subtype
self.type = type
@property
def oui(self):
"""
Returns the value of the `oui` property.
"""
return self._oui
@oui.setter
def oui(self, value):
"""
Sets the value of the `oui` property.
"""
self._oui = value
@property
def subtype(self):
"""
Returns the value of the `subtype` property.
"""
return self._subtype
@subtype.setter
def subtype(self, value):
"""
Sets the value of the `subtype` property.
"""
self._subtype = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
@property
def properties(self):
"""
Returns the value of the `properties` property.
"""
return self._properties
@properties.setter
def properties(self, value):
"""
Sets the value of the `properties` property.
"""
self._properties = value
class LogicalUnit(Struct):
def __init__(
self,
address=None,
discard_max_size=None,
discard_zeroes_data=None,
disk_id=None,
id=None,
lun_mapping=None,
password=None,
paths=None,
port=None,
portal=None,
product_id=None,
serial=None,
size=None,
status=None,
storage_domain_id=None,
target=None,
username=None,
vendor_id=None,
volume_group_id=None,
):
super(LogicalUnit, self).__init__(
)
self.address = address
self.discard_max_size = discard_max_size
self.discard_zeroes_data = discard_zeroes_data
self.disk_id = disk_id
self.id = id
self.lun_mapping = lun_mapping
self.password = password
self.paths = paths
self.port = port
self.portal = portal
self.product_id = product_id
self.serial = serial
self.size = size
self.status = status
self.storage_domain_id = storage_domain_id
self.target = target
self.username = username
self.vendor_id = vendor_id
self.volume_group_id = volume_group_id
@property
def storage_domain_id(self):
"""
Returns the value of the `storage_domain_id` property.
"""
return self._storage_domain_id
@storage_domain_id.setter
def storage_domain_id(self, value):
"""
Sets the value of the `storage_domain_id` property.
"""
self._storage_domain_id = value
@property
def vendor_id(self):
"""
Returns the value of the `vendor_id` property.
"""
return self._vendor_id
@vendor_id.setter
def vendor_id(self, value):
"""
Sets the value of the `vendor_id` property.
"""
self._vendor_id = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def product_id(self):
"""
Returns the value of the `product_id` property.
"""
return self._product_id
@product_id.setter
def product_id(self, value):
"""
Sets the value of the `product_id` property.
"""
self._product_id = value
@property
def discard_zeroes_data(self):
"""
Returns the value of the `discard_zeroes_data` property.
"""
return self._discard_zeroes_data
@discard_zeroes_data.setter
def discard_zeroes_data(self, value):
"""
Sets the value of the `discard_zeroes_data` property.
"""
self._discard_zeroes_data = value
@property
def disk_id(self):
"""
Returns the value of the `disk_id` property.
"""
return self._disk_id
@disk_id.setter
def disk_id(self, value):
"""
Sets the value of the `disk_id` property.
"""
self._disk_id = value
@property
def target(self):
"""
Returns the value of the `target` property.
"""
return self._target
@target.setter
def target(self, value):
"""
Sets the value of the `target` property.
"""
self._target = value
@property
def serial(self):
"""
Returns the value of the `serial` property.
"""
return self._serial
@serial.setter
def serial(self, value):
"""
Sets the value of the `serial` property.
"""
self._serial = value
@property
def discard_max_size(self):
"""
Returns the value of the `discard_max_size` property.
"""
return self._discard_max_size
@discard_max_size.setter
def discard_max_size(self, value):
"""
Sets the value of the `discard_max_size` property.
"""
self._discard_max_size = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def lun_mapping(self):
"""
Returns the value of the `lun_mapping` property.
"""
return self._lun_mapping
@lun_mapping.setter
def lun_mapping(self, value):
"""
Sets the value of the `lun_mapping` property.
"""
self._lun_mapping = value
@property
def size(self):
"""
Returns the value of the `size` property.
"""
return self._size
@size.setter
def size(self, value):
"""
Sets the value of the `size` property.
"""
self._size = value
@property
def paths(self):
"""
Returns the value of the `paths` property.
"""
return self._paths
@paths.setter
def paths(self, value):
"""
Sets the value of the `paths` property.
"""
self._paths = value
@property
def id(self):
"""
Returns the value of the `id` property.
"""
return self._id
@id.setter
def id(self, value):
"""
Sets the value of the `id` property.
"""
self._id = value
@property
def portal(self):
"""
Returns the value of the `portal` property.
"""
return self._portal
@portal.setter
def portal(self, value):
"""
Sets the value of the `portal` property.
"""
self._portal = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, LunStatus)
self._status = value
@property
def volume_group_id(self):
"""
Returns the value of the `volume_group_id` property.
"""
return self._volume_group_id
@volume_group_id.setter
def volume_group_id(self, value):
"""
Sets the value of the `volume_group_id` property.
"""
self._volume_group_id = value
class MDevType(Struct):
def __init__(
self,
available_instances=None,
description=None,
human_readable_name=None,
name=None,
):
super(MDevType, self).__init__(
)
self.available_instances = available_instances
self.description = description
self.human_readable_name = human_readable_name
self.name = name
@property
def human_readable_name(self):
"""
Returns the value of the `human_readable_name` property.
"""
return self._human_readable_name
@human_readable_name.setter
def human_readable_name(self, value):
"""
Sets the value of the `human_readable_name` property.
"""
self._human_readable_name = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def available_instances(self):
"""
Returns the value of the `available_instances` property.
"""
return self._available_instances
@available_instances.setter
def available_instances(self, value):
"""
Sets the value of the `available_instances` property.
"""
self._available_instances = value
@property
def description(self):
"""
Returns the value of the `description` property.
"""
return self._description
@description.setter
def description(self, value):
"""
Sets the value of the `description` property.
"""
self._description = value
class Mac(Struct):
def __init__(
self,
address=None,
):
super(Mac, self).__init__(
)
self.address = address
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
class MacPool(Identified):
def __init__(
self,
allow_duplicates=None,
comment=None,
default_pool=None,
description=None,
id=None,
name=None,
permissions=None,
ranges=None,
):
super(MacPool, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.allow_duplicates = allow_duplicates
self.default_pool = default_pool
self.permissions = permissions
self.ranges = ranges
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def allow_duplicates(self):
"""
Returns the value of the `allow_duplicates` property.
"""
return self._allow_duplicates
@allow_duplicates.setter
def allow_duplicates(self, value):
"""
Sets the value of the `allow_duplicates` property.
"""
self._allow_duplicates = value
@property
def default_pool(self):
"""
Returns the value of the `default_pool` property.
"""
return self._default_pool
@default_pool.setter
def default_pool(self, value):
"""
Sets the value of the `default_pool` property.
"""
self._default_pool = value
@property
def ranges(self):
"""
Returns the value of the `ranges` property.
"""
return self._ranges
@ranges.setter
def ranges(self, value):
"""
Sets the value of the `ranges` property.
"""
self._ranges = value
class MemoryOverCommit(Struct):
def __init__(
self,
percent=None,
):
super(MemoryOverCommit, self).__init__(
)
self.percent = percent
@property
def percent(self):
"""
Returns the value of the `percent` property.
"""
return self._percent
@percent.setter
def percent(self, value):
"""
Sets the value of the `percent` property.
"""
self._percent = value
class MemoryPolicy(Struct):
def __init__(
self,
ballooning=None,
guaranteed=None,
max=None,
over_commit=None,
transparent_huge_pages=None,
):
super(MemoryPolicy, self).__init__(
)
self.ballooning = ballooning
self.guaranteed = guaranteed
self.max = max
self.over_commit = over_commit
self.transparent_huge_pages = transparent_huge_pages
@property
def max(self):
"""
Returns the value of the `max` property.
"""
return self._max
@max.setter
def max(self, value):
"""
Sets the value of the `max` property.
"""
self._max = value
@property
def over_commit(self):
"""
Returns the value of the `over_commit` property.
"""
return self._over_commit
@over_commit.setter
def over_commit(self, value):
"""
Sets the value of the `over_commit` property.
"""
Struct._check_type('over_commit', value, MemoryOverCommit)
self._over_commit = value
@property
def ballooning(self):
"""
Returns the value of the `ballooning` property.
"""
return self._ballooning
@ballooning.setter
def ballooning(self, value):
"""
Sets the value of the `ballooning` property.
"""
self._ballooning = value
@property
def transparent_huge_pages(self):
"""
Returns the value of the `transparent_huge_pages` property.
"""
return self._transparent_huge_pages
@transparent_huge_pages.setter
def transparent_huge_pages(self, value):
"""
Sets the value of the `transparent_huge_pages` property.
"""
Struct._check_type('transparent_huge_pages', value, TransparentHugePages)
self._transparent_huge_pages = value
@property
def guaranteed(self):
"""
Returns the value of the `guaranteed` property.
"""
return self._guaranteed
@guaranteed.setter
def guaranteed(self, value):
"""
Sets the value of the `guaranteed` property.
"""
self._guaranteed = value
class Method(Struct):
def __init__(
self,
id=None,
):
super(Method, self).__init__(
)
self.id = id
@property
def id(self):
"""
Returns the value of the `id` property.
"""
return self._id
@id.setter
def id(self, value):
"""
Sets the value of the `id` property.
"""
Struct._check_type('id', value, SsoMethod)
self._id = value
class MigrationBandwidth(Struct):
def __init__(
self,
assignment_method=None,
custom_value=None,
):
super(MigrationBandwidth, self).__init__(
)
self.assignment_method = assignment_method
self.custom_value = custom_value
@property
def custom_value(self):
"""
Returns the value of the `custom_value` property.
"""
return self._custom_value
@custom_value.setter
def custom_value(self, value):
"""
Sets the value of the `custom_value` property.
"""
self._custom_value = value
@property
def assignment_method(self):
"""
Returns the value of the `assignment_method` property.
"""
return self._assignment_method
@assignment_method.setter
def assignment_method(self, value):
"""
Sets the value of the `assignment_method` property.
"""
Struct._check_type('assignment_method', value, MigrationBandwidthAssignmentMethod)
self._assignment_method = value
class MigrationOptions(Struct):
def __init__(
self,
auto_converge=None,
bandwidth=None,
compressed=None,
encrypted=None,
policy=None,
):
super(MigrationOptions, self).__init__(
)
self.auto_converge = auto_converge
self.bandwidth = bandwidth
self.compressed = compressed
self.encrypted = encrypted
self.policy = policy
@property
def encrypted(self):
"""
Returns the value of the `encrypted` property.
"""
return self._encrypted
@encrypted.setter
def encrypted(self, value):
"""
Sets the value of the `encrypted` property.
"""
Struct._check_type('encrypted', value, InheritableBoolean)
self._encrypted = value
@property
def bandwidth(self):
"""
Returns the value of the `bandwidth` property.
"""
return self._bandwidth
@bandwidth.setter
def bandwidth(self, value):
"""
Sets the value of the `bandwidth` property.
"""
Struct._check_type('bandwidth', value, MigrationBandwidth)
self._bandwidth = value
@property
def auto_converge(self):
"""
Returns the value of the `auto_converge` property.
"""
return self._auto_converge
@auto_converge.setter
def auto_converge(self, value):
"""
Sets the value of the `auto_converge` property.
"""
Struct._check_type('auto_converge', value, InheritableBoolean)
self._auto_converge = value
@property
def compressed(self):
"""
Returns the value of the `compressed` property.
"""
return self._compressed
@compressed.setter
def compressed(self, value):
"""
Sets the value of the `compressed` property.
"""
Struct._check_type('compressed', value, InheritableBoolean)
self._compressed = value
@property
def policy(self):
"""
Returns the value of the `policy` property.
"""
return self._policy
@policy.setter
def policy(self, value):
"""
Sets the value of the `policy` property.
"""
Struct._check_type('policy', value, MigrationPolicy)
self._policy = value
class MigrationPolicy(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
):
super(MigrationPolicy, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
pass
class Network(Identified):
def __init__(
self,
cluster=None,
comment=None,
data_center=None,
description=None,
display=None,
dns_resolver_configuration=None,
external_provider=None,
external_provider_physical_network=None,
id=None,
ip=None,
mtu=None,
name=None,
network_labels=None,
permissions=None,
port_isolation=None,
profile_required=None,
qos=None,
required=None,
status=None,
stp=None,
usages=None,
vdsm_name=None,
vlan=None,
vnic_profiles=None,
):
super(Network, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster = cluster
self.data_center = data_center
self.display = display
self.dns_resolver_configuration = dns_resolver_configuration
self.external_provider = external_provider
self.external_provider_physical_network = external_provider_physical_network
self.ip = ip
self.mtu = mtu
self.network_labels = network_labels
self.permissions = permissions
self.port_isolation = port_isolation
self.profile_required = profile_required
self.qos = qos
self.required = required
self.status = status
self.stp = stp
self.usages = usages
self.vdsm_name = vdsm_name
self.vlan = vlan
self.vnic_profiles = vnic_profiles
@property
def dns_resolver_configuration(self):
"""
Returns the value of the `dns_resolver_configuration` property.
"""
return self._dns_resolver_configuration
@dns_resolver_configuration.setter
def dns_resolver_configuration(self, value):
"""
Sets the value of the `dns_resolver_configuration` property.
"""
Struct._check_type('dns_resolver_configuration', value, DnsResolverConfiguration)
self._dns_resolver_configuration = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def external_provider_physical_network(self):
"""
Returns the value of the `external_provider_physical_network` property.
"""
return self._external_provider_physical_network
@external_provider_physical_network.setter
def external_provider_physical_network(self, value):
"""
Sets the value of the `external_provider_physical_network` property.
"""
Struct._check_type('external_provider_physical_network', value, Network)
self._external_provider_physical_network = value
@property
def display(self):
"""
Returns the value of the `display` property.
"""
return self._display
@display.setter
def display(self, value):
"""
Sets the value of the `display` property.
"""
self._display = value
@property
def profile_required(self):
"""
Returns the value of the `profile_required` property.
"""
return self._profile_required
@profile_required.setter
def profile_required(self, value):
"""
Sets the value of the `profile_required` property.
"""
self._profile_required = value
@property
def vdsm_name(self):
"""
Returns the value of the `vdsm_name` property.
"""
return self._vdsm_name
@vdsm_name.setter
def vdsm_name(self, value):
"""
Sets the value of the `vdsm_name` property.
"""
self._vdsm_name = value
@property
def ip(self):
"""
Returns the value of the `ip` property.
"""
return self._ip
@ip.setter
def ip(self, value):
"""
Sets the value of the `ip` property.
"""
Struct._check_type('ip', value, Ip)
self._ip = value
@property
def network_labels(self):
"""
Returns the value of the `network_labels` property.
"""
return self._network_labels
@network_labels.setter
def network_labels(self, value):
"""
Sets the value of the `network_labels` property.
"""
self._network_labels = value
@property
def mtu(self):
"""
Returns the value of the `mtu` property.
"""
return self._mtu
@mtu.setter
def mtu(self, value):
"""
Sets the value of the `mtu` property.
"""
self._mtu = value
@property
def vnic_profiles(self):
"""
Returns the value of the `vnic_profiles` property.
"""
return self._vnic_profiles
@vnic_profiles.setter
def vnic_profiles(self, value):
"""
Sets the value of the `vnic_profiles` property.
"""
self._vnic_profiles = value
@property
def port_isolation(self):
"""
Returns the value of the `port_isolation` property.
"""
return self._port_isolation
@port_isolation.setter
def port_isolation(self, value):
"""
Sets the value of the `port_isolation` property.
"""
self._port_isolation = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def stp(self):
"""
Returns the value of the `stp` property.
"""
return self._stp
@stp.setter
def stp(self, value):
"""
Sets the value of the `stp` property.
"""
self._stp = value
@property
def required(self):
"""
Returns the value of the `required` property.
"""
return self._required
@required.setter
def required(self, value):
"""
Sets the value of the `required` property.
"""
self._required = value
@property
def external_provider(self):
"""
Returns the value of the `external_provider` property.
"""
return self._external_provider
@external_provider.setter
def external_provider(self, value):
"""
Sets the value of the `external_provider` property.
"""
Struct._check_type('external_provider', value, OpenStackNetworkProvider)
self._external_provider = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def vlan(self):
"""
Returns the value of the `vlan` property.
"""
return self._vlan
@vlan.setter
def vlan(self, value):
"""
Sets the value of the `vlan` property.
"""
Struct._check_type('vlan', value, Vlan)
self._vlan = value
@property
def qos(self):
"""
Returns the value of the `qos` property.
"""
return self._qos
@qos.setter
def qos(self, value):
"""
Sets the value of the `qos` property.
"""
Struct._check_type('qos', value, Qos)
self._qos = value
@property
def usages(self):
"""
Returns the value of the `usages` property.
"""
return self._usages
@usages.setter
def usages(self, value):
"""
Sets the value of the `usages` property.
"""
self._usages = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, NetworkStatus)
self._status = value
class NetworkAttachment(Identified):
def __init__(
self,
comment=None,
description=None,
dns_resolver_configuration=None,
host=None,
host_nic=None,
id=None,
in_sync=None,
ip_address_assignments=None,
name=None,
network=None,
properties=None,
qos=None,
reported_configurations=None,
):
super(NetworkAttachment, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.dns_resolver_configuration = dns_resolver_configuration
self.host = host
self.host_nic = host_nic
self.in_sync = in_sync
self.ip_address_assignments = ip_address_assignments
self.network = network
self.properties = properties
self.qos = qos
self.reported_configurations = reported_configurations
@property
def in_sync(self):
"""
Returns the value of the `in_sync` property.
"""
return self._in_sync
@in_sync.setter
def in_sync(self, value):
"""
Sets the value of the `in_sync` property.
"""
self._in_sync = value
@property
def reported_configurations(self):
"""
Returns the value of the `reported_configurations` property.
"""
return self._reported_configurations
@reported_configurations.setter
def reported_configurations(self, value):
"""
Sets the value of the `reported_configurations` property.
"""
self._reported_configurations = value
@property
def dns_resolver_configuration(self):
"""
Returns the value of the `dns_resolver_configuration` property.
"""
return self._dns_resolver_configuration
@dns_resolver_configuration.setter
def dns_resolver_configuration(self, value):
"""
Sets the value of the `dns_resolver_configuration` property.
"""
Struct._check_type('dns_resolver_configuration', value, DnsResolverConfiguration)
self._dns_resolver_configuration = value
@property
def qos(self):
"""
Returns the value of the `qos` property.
"""
return self._qos
@qos.setter
def qos(self, value):
"""
Sets the value of the `qos` property.
"""
Struct._check_type('qos', value, Qos)
self._qos = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def ip_address_assignments(self):
"""
Returns the value of the `ip_address_assignments` property.
"""
return self._ip_address_assignments
@ip_address_assignments.setter
def ip_address_assignments(self, value):
"""
Sets the value of the `ip_address_assignments` property.
"""
self._ip_address_assignments = value
@property
def network(self):
"""
Returns the value of the `network` property.
"""
return self._network
@network.setter
def network(self, value):
"""
Sets the value of the `network` property.
"""
Struct._check_type('network', value, Network)
self._network = value
@property
def host_nic(self):
"""
Returns the value of the `host_nic` property.
"""
return self._host_nic
@host_nic.setter
def host_nic(self, value):
"""
Sets the value of the `host_nic` property.
"""
Struct._check_type('host_nic', value, HostNic)
self._host_nic = value
@property
def properties(self):
"""
Returns the value of the `properties` property.
"""
return self._properties
@properties.setter
def properties(self, value):
"""
Sets the value of the `properties` property.
"""
self._properties = value
class NetworkConfiguration(Struct):
def __init__(
self,
dns=None,
nics=None,
):
super(NetworkConfiguration, self).__init__(
)
self.dns = dns
self.nics = nics
@property
def nics(self):
"""
Returns the value of the `nics` property.
"""
return self._nics
@nics.setter
def nics(self, value):
"""
Sets the value of the `nics` property.
"""
self._nics = value
@property
def dns(self):
"""
Returns the value of the `dns` property.
"""
return self._dns
@dns.setter
def dns(self, value):
"""
Sets the value of the `dns` property.
"""
Struct._check_type('dns', value, Dns)
self._dns = value
class NetworkFilter(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
version=None,
):
super(NetworkFilter, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.version = version
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
class NetworkFilterParameter(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
nic=None,
value=None,
):
super(NetworkFilterParameter, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.nic = nic
self.value = value
@property
def nic(self):
"""
Returns the value of the `nic` property.
"""
return self._nic
@nic.setter
def nic(self, value):
"""
Sets the value of the `nic` property.
"""
Struct._check_type('nic', value, Nic)
self._nic = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class NetworkLabel(Identified):
def __init__(
self,
comment=None,
description=None,
host_nic=None,
id=None,
name=None,
network=None,
):
super(NetworkLabel, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.host_nic = host_nic
self.network = network
@property
def network(self):
"""
Returns the value of the `network` property.
"""
return self._network
@network.setter
def network(self, value):
"""
Sets the value of the `network` property.
"""
Struct._check_type('network', value, Network)
self._network = value
@property
def host_nic(self):
"""
Returns the value of the `host_nic` property.
"""
return self._host_nic
@host_nic.setter
def host_nic(self, value):
"""
Sets the value of the `host_nic` property.
"""
Struct._check_type('host_nic', value, HostNic)
self._host_nic = value
class NfsProfileDetail(EntityProfileDetail):
def __init__(
self,
nfs_server_ip=None,
profile_details=None,
):
super(NfsProfileDetail, self).__init__(
profile_details=profile_details,
)
self.nfs_server_ip = nfs_server_ip
@property
def nfs_server_ip(self):
"""
Returns the value of the `nfs_server_ip` property.
"""
return self._nfs_server_ip
@nfs_server_ip.setter
def nfs_server_ip(self, value):
"""
Sets the value of the `nfs_server_ip` property.
"""
self._nfs_server_ip = value
class NicConfiguration(Struct):
def __init__(
self,
boot_protocol=None,
ip=None,
ipv6=None,
ipv6_boot_protocol=None,
name=None,
on_boot=None,
):
super(NicConfiguration, self).__init__(
)
self.boot_protocol = boot_protocol
self.ip = ip
self.ipv6 = ipv6
self.ipv6_boot_protocol = ipv6_boot_protocol
self.name = name
self.on_boot = on_boot
@property
def boot_protocol(self):
"""
Returns the value of the `boot_protocol` property.
"""
return self._boot_protocol
@boot_protocol.setter
def boot_protocol(self, value):
"""
Sets the value of the `boot_protocol` property.
"""
Struct._check_type('boot_protocol', value, BootProtocol)
self._boot_protocol = value
@property
def ip(self):
"""
Returns the value of the `ip` property.
"""
return self._ip
@ip.setter
def ip(self, value):
"""
Sets the value of the `ip` property.
"""
Struct._check_type('ip', value, Ip)
self._ip = value
@property
def ipv6(self):
"""
Returns the value of the `ipv6` property.
"""
return self._ipv6
@ipv6.setter
def ipv6(self, value):
"""
Sets the value of the `ipv6` property.
"""
Struct._check_type('ipv6', value, Ip)
self._ipv6 = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def on_boot(self):
"""
Returns the value of the `on_boot` property.
"""
return self._on_boot
@on_boot.setter
def on_boot(self, value):
"""
Sets the value of the `on_boot` property.
"""
self._on_boot = value
@property
def ipv6_boot_protocol(self):
"""
Returns the value of the `ipv6_boot_protocol` property.
"""
return self._ipv6_boot_protocol
@ipv6_boot_protocol.setter
def ipv6_boot_protocol(self, value):
"""
Sets the value of the `ipv6_boot_protocol` property.
"""
Struct._check_type('ipv6_boot_protocol', value, BootProtocol)
self._ipv6_boot_protocol = value
class NumaNode(Identified):
def __init__(
self,
comment=None,
cpu=None,
description=None,
host=None,
id=None,
index=None,
memory=None,
name=None,
node_distance=None,
statistics=None,
):
super(NumaNode, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cpu = cpu
self.host = host
self.index = index
self.memory = memory
self.node_distance = node_distance
self.statistics = statistics
@property
def memory(self):
"""
Returns the value of the `memory` property.
"""
return self._memory
@memory.setter
def memory(self, value):
"""
Sets the value of the `memory` property.
"""
self._memory = value
@property
def cpu(self):
"""
Returns the value of the `cpu` property.
"""
return self._cpu
@cpu.setter
def cpu(self, value):
"""
Sets the value of the `cpu` property.
"""
Struct._check_type('cpu', value, Cpu)
self._cpu = value
@property
def node_distance(self):
"""
Returns the value of the `node_distance` property.
"""
return self._node_distance
@node_distance.setter
def node_distance(self, value):
"""
Sets the value of the `node_distance` property.
"""
self._node_distance = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def index(self):
"""
Returns the value of the `index` property.
"""
return self._index
@index.setter
def index(self, value):
"""
Sets the value of the `index` property.
"""
self._index = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
class NumaNodePin(Struct):
def __init__(
self,
host_numa_node=None,
index=None,
pinned=None,
):
super(NumaNodePin, self).__init__(
)
self.host_numa_node = host_numa_node
self.index = index
self.pinned = pinned
@property
def index(self):
"""
Returns the value of the `index` property.
"""
return self._index
@index.setter
def index(self, value):
"""
Sets the value of the `index` property.
"""
self._index = value
@property
def host_numa_node(self):
"""
Returns the value of the `host_numa_node` property.
"""
return self._host_numa_node
@host_numa_node.setter
def host_numa_node(self, value):
"""
Sets the value of the `host_numa_node` property.
"""
Struct._check_type('host_numa_node', value, NumaNode)
self._host_numa_node = value
@property
def pinned(self):
"""
Returns the value of the `pinned` property.
"""
return self._pinned
@pinned.setter
def pinned(self, value):
"""
Sets the value of the `pinned` property.
"""
self._pinned = value
class OpenStackImage(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
openstack_image_provider=None,
):
super(OpenStackImage, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.openstack_image_provider = openstack_image_provider
@property
def openstack_image_provider(self):
"""
Returns the value of the `openstack_image_provider` property.
"""
return self._openstack_image_provider
@openstack_image_provider.setter
def openstack_image_provider(self, value):
"""
Sets the value of the `openstack_image_provider` property.
"""
Struct._check_type('openstack_image_provider', value, OpenStackImageProvider)
self._openstack_image_provider = value
class OpenStackNetwork(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
openstack_network_provider=None,
):
super(OpenStackNetwork, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.openstack_network_provider = openstack_network_provider
@property
def openstack_network_provider(self):
"""
Returns the value of the `openstack_network_provider` property.
"""
return self._openstack_network_provider
@openstack_network_provider.setter
def openstack_network_provider(self, value):
"""
Sets the value of the `openstack_network_provider` property.
"""
Struct._check_type('openstack_network_provider', value, OpenStackNetworkProvider)
self._openstack_network_provider = value
class OpenStackSubnet(Identified):
def __init__(
self,
cidr=None,
comment=None,
description=None,
dns_servers=None,
gateway=None,
id=None,
ip_version=None,
name=None,
openstack_network=None,
):
super(OpenStackSubnet, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cidr = cidr
self.dns_servers = dns_servers
self.gateway = gateway
self.ip_version = ip_version
self.openstack_network = openstack_network
@property
def ip_version(self):
"""
Returns the value of the `ip_version` property.
"""
return self._ip_version
@ip_version.setter
def ip_version(self, value):
"""
Sets the value of the `ip_version` property.
"""
self._ip_version = value
@property
def gateway(self):
"""
Returns the value of the `gateway` property.
"""
return self._gateway
@gateway.setter
def gateway(self, value):
"""
Sets the value of the `gateway` property.
"""
self._gateway = value
@property
def dns_servers(self):
"""
Returns the value of the `dns_servers` property.
"""
return self._dns_servers
@dns_servers.setter
def dns_servers(self, value):
"""
Sets the value of the `dns_servers` property.
"""
self._dns_servers = value
@property
def openstack_network(self):
"""
Returns the value of the `openstack_network` property.
"""
return self._openstack_network
@openstack_network.setter
def openstack_network(self, value):
"""
Sets the value of the `openstack_network` property.
"""
Struct._check_type('openstack_network', value, OpenStackNetwork)
self._openstack_network = value
@property
def cidr(self):
"""
Returns the value of the `cidr` property.
"""
return self._cidr
@cidr.setter
def cidr(self, value):
"""
Sets the value of the `cidr` property.
"""
self._cidr = value
class OpenStackVolumeType(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
openstack_volume_provider=None,
properties=None,
):
super(OpenStackVolumeType, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.openstack_volume_provider = openstack_volume_provider
self.properties = properties
@property
def openstack_volume_provider(self):
"""
Returns the value of the `openstack_volume_provider` property.
"""
return self._openstack_volume_provider
@openstack_volume_provider.setter
def openstack_volume_provider(self, value):
"""
Sets the value of the `openstack_volume_provider` property.
"""
Struct._check_type('openstack_volume_provider', value, OpenStackVolumeProvider)
self._openstack_volume_provider = value
@property
def properties(self):
"""
Returns the value of the `properties` property.
"""
return self._properties
@properties.setter
def properties(self, value):
"""
Sets the value of the `properties` property.
"""
self._properties = value
class OpenstackVolumeAuthenticationKey(Identified):
def __init__(
self,
comment=None,
creation_date=None,
description=None,
id=None,
name=None,
openstack_volume_provider=None,
usage_type=None,
uuid=None,
value=None,
):
super(OpenstackVolumeAuthenticationKey, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.creation_date = creation_date
self.openstack_volume_provider = openstack_volume_provider
self.usage_type = usage_type
self.uuid = uuid
self.value = value
@property
def openstack_volume_provider(self):
"""
Returns the value of the `openstack_volume_provider` property.
"""
return self._openstack_volume_provider
@openstack_volume_provider.setter
def openstack_volume_provider(self, value):
"""
Sets the value of the `openstack_volume_provider` property.
"""
Struct._check_type('openstack_volume_provider', value, OpenStackVolumeProvider)
self._openstack_volume_provider = value
@property
def usage_type(self):
"""
Returns the value of the `usage_type` property.
"""
return self._usage_type
@usage_type.setter
def usage_type(self, value):
"""
Sets the value of the `usage_type` property.
"""
Struct._check_type('usage_type', value, OpenstackVolumeAuthenticationKeyUsageType)
self._usage_type = value
@property
def creation_date(self):
"""
Returns the value of the `creation_date` property.
"""
return self._creation_date
@creation_date.setter
def creation_date(self, value):
"""
Sets the value of the `creation_date` property.
"""
self._creation_date = value
@property
def uuid(self):
"""
Returns the value of the `uuid` property.
"""
return self._uuid
@uuid.setter
def uuid(self, value):
"""
Sets the value of the `uuid` property.
"""
self._uuid = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class OperatingSystem(Struct):
def __init__(
self,
boot=None,
cmdline=None,
custom_kernel_cmdline=None,
initrd=None,
kernel=None,
reported_kernel_cmdline=None,
type=None,
version=None,
):
super(OperatingSystem, self).__init__(
)
self.boot = boot
self.cmdline = cmdline
self.custom_kernel_cmdline = custom_kernel_cmdline
self.initrd = initrd
self.kernel = kernel
self.reported_kernel_cmdline = reported_kernel_cmdline
self.type = type
self.version = version
@property
def cmdline(self):
"""
Returns the value of the `cmdline` property.
"""
return self._cmdline
@cmdline.setter
def cmdline(self, value):
"""
Sets the value of the `cmdline` property.
"""
self._cmdline = value
@property
def reported_kernel_cmdline(self):
"""
Returns the value of the `reported_kernel_cmdline` property.
"""
return self._reported_kernel_cmdline
@reported_kernel_cmdline.setter
def reported_kernel_cmdline(self, value):
"""
Sets the value of the `reported_kernel_cmdline` property.
"""
self._reported_kernel_cmdline = value
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
@property
def kernel(self):
"""
Returns the value of the `kernel` property.
"""
return self._kernel
@kernel.setter
def kernel(self, value):
"""
Sets the value of the `kernel` property.
"""
self._kernel = value
@property
def custom_kernel_cmdline(self):
"""
Returns the value of the `custom_kernel_cmdline` property.
"""
return self._custom_kernel_cmdline
@custom_kernel_cmdline.setter
def custom_kernel_cmdline(self, value):
"""
Sets the value of the `custom_kernel_cmdline` property.
"""
self._custom_kernel_cmdline = value
@property
def initrd(self):
"""
Returns the value of the `initrd` property.
"""
return self._initrd
@initrd.setter
def initrd(self, value):
"""
Sets the value of the `initrd` property.
"""
self._initrd = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
@property
def boot(self):
"""
Returns the value of the `boot` property.
"""
return self._boot
@boot.setter
def boot(self, value):
"""
Sets the value of the `boot` property.
"""
Struct._check_type('boot', value, Boot)
self._boot = value
class OperatingSystemInfo(Identified):
def __init__(
self,
architecture=None,
comment=None,
description=None,
id=None,
large_icon=None,
name=None,
small_icon=None,
):
super(OperatingSystemInfo, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.architecture = architecture
self.large_icon = large_icon
self.small_icon = small_icon
@property
def large_icon(self):
"""
Returns the value of the `large_icon` property.
"""
return self._large_icon
@large_icon.setter
def large_icon(self, value):
"""
Sets the value of the `large_icon` property.
"""
Struct._check_type('large_icon', value, Icon)
self._large_icon = value
@property
def architecture(self):
"""
Returns the value of the `architecture` property.
"""
return self._architecture
@architecture.setter
def architecture(self, value):
"""
Sets the value of the `architecture` property.
"""
Struct._check_type('architecture', value, Architecture)
self._architecture = value
@property
def small_icon(self):
"""
Returns the value of the `small_icon` property.
"""
return self._small_icon
@small_icon.setter
def small_icon(self, value):
"""
Sets the value of the `small_icon` property.
"""
Struct._check_type('small_icon', value, Icon)
self._small_icon = value
class Option(Struct):
def __init__(
self,
name=None,
type=None,
value=None,
):
super(Option, self).__init__(
)
self.name = name
self.type = type
self.value = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
class Package(Struct):
def __init__(
self,
name=None,
):
super(Package, self).__init__(
)
self.name = name
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
class Payload(Struct):
def __init__(
self,
files=None,
type=None,
volume_id=None,
):
super(Payload, self).__init__(
)
self.files = files
self.type = type
self.volume_id = volume_id
@property
def volume_id(self):
"""
Returns the value of the `volume_id` property.
"""
return self._volume_id
@volume_id.setter
def volume_id(self, value):
"""
Sets the value of the `volume_id` property.
"""
self._volume_id = value
@property
def files(self):
"""
Returns the value of the `files` property.
"""
return self._files
@files.setter
def files(self, value):
"""
Sets the value of the `files` property.
"""
self._files = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, VmDeviceType)
self._type = value
class Permission(Identified):
def __init__(
self,
cluster=None,
comment=None,
data_center=None,
description=None,
disk=None,
group=None,
host=None,
id=None,
name=None,
role=None,
storage_domain=None,
template=None,
user=None,
vm=None,
vm_pool=None,
):
super(Permission, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster = cluster
self.data_center = data_center
self.disk = disk
self.group = group
self.host = host
self.role = role
self.storage_domain = storage_domain
self.template = template
self.user = user
self.vm = vm
self.vm_pool = vm_pool
@property
def role(self):
"""
Returns the value of the `role` property.
"""
return self._role
@role.setter
def role(self, value):
"""
Sets the value of the `role` property.
"""
Struct._check_type('role', value, Role)
self._role = value
@property
def vm_pool(self):
"""
Returns the value of the `vm_pool` property.
"""
return self._vm_pool
@vm_pool.setter
def vm_pool(self, value):
"""
Sets the value of the `vm_pool` property.
"""
Struct._check_type('vm_pool', value, VmPool)
self._vm_pool = value
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def disk(self):
"""
Returns the value of the `disk` property.
"""
return self._disk
@disk.setter
def disk(self, value):
"""
Sets the value of the `disk` property.
"""
Struct._check_type('disk', value, Disk)
self._disk = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def group(self):
"""
Returns the value of the `group` property.
"""
return self._group
@group.setter
def group(self, value):
"""
Sets the value of the `group` property.
"""
Struct._check_type('group', value, Group)
self._group = value
class Permit(Identified):
def __init__(
self,
administrative=None,
comment=None,
description=None,
id=None,
name=None,
role=None,
):
super(Permit, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.administrative = administrative
self.role = role
@property
def role(self):
"""
Returns the value of the `role` property.
"""
return self._role
@role.setter
def role(self, value):
"""
Sets the value of the `role` property.
"""
Struct._check_type('role', value, Role)
self._role = value
@property
def administrative(self):
"""
Returns the value of the `administrative` property.
"""
return self._administrative
@administrative.setter
def administrative(self, value):
"""
Sets the value of the `administrative` property.
"""
self._administrative = value
class PmProxy(Struct):
def __init__(
self,
type=None,
):
super(PmProxy, self).__init__(
)
self.type = type
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, PmProxyType)
self._type = value
class PortMirroring(Struct):
def __init__(
self,
):
super(PortMirroring, self).__init__(
)
pass
class PowerManagement(Struct):
def __init__(
self,
address=None,
agents=None,
automatic_pm_enabled=None,
enabled=None,
kdump_detection=None,
options=None,
password=None,
pm_proxies=None,
status=None,
type=None,
username=None,
):
super(PowerManagement, self).__init__(
)
self.address = address
self.agents = agents
self.automatic_pm_enabled = automatic_pm_enabled
self.enabled = enabled
self.kdump_detection = kdump_detection
self.options = options
self.password = password
self.pm_proxies = pm_proxies
self.status = status
self.type = type
self.username = username
@property
def kdump_detection(self):
"""
Returns the value of the `kdump_detection` property.
"""
return self._kdump_detection
@kdump_detection.setter
def kdump_detection(self, value):
"""
Sets the value of the `kdump_detection` property.
"""
self._kdump_detection = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def pm_proxies(self):
"""
Returns the value of the `pm_proxies` property.
"""
return self._pm_proxies
@pm_proxies.setter
def pm_proxies(self, value):
"""
Sets the value of the `pm_proxies` property.
"""
self._pm_proxies = value
@property
def options(self):
"""
Returns the value of the `options` property.
"""
return self._options
@options.setter
def options(self, value):
"""
Sets the value of the `options` property.
"""
self._options = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, PowerManagementStatus)
self._status = value
@property
def agents(self):
"""
Returns the value of the `agents` property.
"""
return self._agents
@agents.setter
def agents(self, value):
"""
Sets the value of the `agents` property.
"""
self._agents = value
@property
def automatic_pm_enabled(self):
"""
Returns the value of the `automatic_pm_enabled` property.
"""
return self._automatic_pm_enabled
@automatic_pm_enabled.setter
def automatic_pm_enabled(self, value):
"""
Sets the value of the `automatic_pm_enabled` property.
"""
self._automatic_pm_enabled = value
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
class Product(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
):
super(Product, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
pass
class ProductInfo(Struct):
def __init__(
self,
instance_id=None,
name=None,
vendor=None,
version=None,
):
super(ProductInfo, self).__init__(
)
self.instance_id = instance_id
self.name = name
self.vendor = vendor
self.version = version
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def vendor(self):
"""
Returns the value of the `vendor` property.
"""
return self._vendor
@vendor.setter
def vendor(self, value):
"""
Sets the value of the `vendor` property.
"""
self._vendor = value
@property
def instance_id(self):
"""
Returns the value of the `instance_id` property.
"""
return self._instance_id
@instance_id.setter
def instance_id(self, value):
"""
Sets the value of the `instance_id` property.
"""
self._instance_id = value
class ProfileDetail(Struct):
def __init__(
self,
block_statistics=None,
duration=None,
fop_statistics=None,
profile_type=None,
statistics=None,
):
super(ProfileDetail, self).__init__(
)
self.block_statistics = block_statistics
self.duration = duration
self.fop_statistics = fop_statistics
self.profile_type = profile_type
self.statistics = statistics
@property
def fop_statistics(self):
"""
Returns the value of the `fop_statistics` property.
"""
return self._fop_statistics
@fop_statistics.setter
def fop_statistics(self, value):
"""
Sets the value of the `fop_statistics` property.
"""
self._fop_statistics = value
@property
def duration(self):
"""
Returns the value of the `duration` property.
"""
return self._duration
@duration.setter
def duration(self, value):
"""
Sets the value of the `duration` property.
"""
self._duration = value
@property
def block_statistics(self):
"""
Returns the value of the `block_statistics` property.
"""
return self._block_statistics
@block_statistics.setter
def block_statistics(self, value):
"""
Sets the value of the `block_statistics` property.
"""
self._block_statistics = value
@property
def profile_type(self):
"""
Returns the value of the `profile_type` property.
"""
return self._profile_type
@profile_type.setter
def profile_type(self, value):
"""
Sets the value of the `profile_type` property.
"""
self._profile_type = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
class Property(Struct):
def __init__(
self,
name=None,
value=None,
):
super(Property, self).__init__(
)
self.name = name
self.value = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class ProxyTicket(Struct):
def __init__(
self,
value=None,
):
super(ProxyTicket, self).__init__(
)
self.value = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class Qos(Identified):
def __init__(
self,
comment=None,
cpu_limit=None,
data_center=None,
description=None,
id=None,
inbound_average=None,
inbound_burst=None,
inbound_peak=None,
max_iops=None,
max_read_iops=None,
max_read_throughput=None,
max_throughput=None,
max_write_iops=None,
max_write_throughput=None,
name=None,
outbound_average=None,
outbound_average_linkshare=None,
outbound_average_realtime=None,
outbound_average_upperlimit=None,
outbound_burst=None,
outbound_peak=None,
type=None,
):
super(Qos, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cpu_limit = cpu_limit
self.data_center = data_center
self.inbound_average = inbound_average
self.inbound_burst = inbound_burst
self.inbound_peak = inbound_peak
self.max_iops = max_iops
self.max_read_iops = max_read_iops
self.max_read_throughput = max_read_throughput
self.max_throughput = max_throughput
self.max_write_iops = max_write_iops
self.max_write_throughput = max_write_throughput
self.outbound_average = outbound_average
self.outbound_average_linkshare = outbound_average_linkshare
self.outbound_average_realtime = outbound_average_realtime
self.outbound_average_upperlimit = outbound_average_upperlimit
self.outbound_burst = outbound_burst
self.outbound_peak = outbound_peak
self.type = type
@property
def max_read_throughput(self):
"""
Returns the value of the `max_read_throughput` property.
"""
return self._max_read_throughput
@max_read_throughput.setter
def max_read_throughput(self, value):
"""
Sets the value of the `max_read_throughput` property.
"""
self._max_read_throughput = value
@property
def max_iops(self):
"""
Returns the value of the `max_iops` property.
"""
return self._max_iops
@max_iops.setter
def max_iops(self, value):
"""
Sets the value of the `max_iops` property.
"""
self._max_iops = value
@property
def max_throughput(self):
"""
Returns the value of the `max_throughput` property.
"""
return self._max_throughput
@max_throughput.setter
def max_throughput(self, value):
"""
Sets the value of the `max_throughput` property.
"""
self._max_throughput = value
@property
def max_read_iops(self):
"""
Returns the value of the `max_read_iops` property.
"""
return self._max_read_iops
@max_read_iops.setter
def max_read_iops(self, value):
"""
Sets the value of the `max_read_iops` property.
"""
self._max_read_iops = value
@property
def outbound_burst(self):
"""
Returns the value of the `outbound_burst` property.
"""
return self._outbound_burst
@outbound_burst.setter
def outbound_burst(self, value):
"""
Sets the value of the `outbound_burst` property.
"""
self._outbound_burst = value
@property
def max_write_iops(self):
"""
Returns the value of the `max_write_iops` property.
"""
return self._max_write_iops
@max_write_iops.setter
def max_write_iops(self, value):
"""
Sets the value of the `max_write_iops` property.
"""
self._max_write_iops = value
@property
def max_write_throughput(self):
"""
Returns the value of the `max_write_throughput` property.
"""
return self._max_write_throughput
@max_write_throughput.setter
def max_write_throughput(self, value):
"""
Sets the value of the `max_write_throughput` property.
"""
self._max_write_throughput = value
@property
def cpu_limit(self):
"""
Returns the value of the `cpu_limit` property.
"""
return self._cpu_limit
@cpu_limit.setter
def cpu_limit(self, value):
"""
Sets the value of the `cpu_limit` property.
"""
self._cpu_limit = value
@property
def inbound_peak(self):
"""
Returns the value of the `inbound_peak` property.
"""
return self._inbound_peak
@inbound_peak.setter
def inbound_peak(self, value):
"""
Sets the value of the `inbound_peak` property.
"""
self._inbound_peak = value
@property
def outbound_average_linkshare(self):
"""
Returns the value of the `outbound_average_linkshare` property.
"""
return self._outbound_average_linkshare
@outbound_average_linkshare.setter
def outbound_average_linkshare(self, value):
"""
Sets the value of the `outbound_average_linkshare` property.
"""
self._outbound_average_linkshare = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, QosType)
self._type = value
@property
def inbound_average(self):
"""
Returns the value of the `inbound_average` property.
"""
return self._inbound_average
@inbound_average.setter
def inbound_average(self, value):
"""
Sets the value of the `inbound_average` property.
"""
self._inbound_average = value
@property
def outbound_average_upperlimit(self):
"""
Returns the value of the `outbound_average_upperlimit` property.
"""
return self._outbound_average_upperlimit
@outbound_average_upperlimit.setter
def outbound_average_upperlimit(self, value):
"""
Sets the value of the `outbound_average_upperlimit` property.
"""
self._outbound_average_upperlimit = value
@property
def inbound_burst(self):
"""
Returns the value of the `inbound_burst` property.
"""
return self._inbound_burst
@inbound_burst.setter
def inbound_burst(self, value):
"""
Sets the value of the `inbound_burst` property.
"""
self._inbound_burst = value
@property
def outbound_peak(self):
"""
Returns the value of the `outbound_peak` property.
"""
return self._outbound_peak
@outbound_peak.setter
def outbound_peak(self, value):
"""
Sets the value of the `outbound_peak` property.
"""
self._outbound_peak = value
@property
def outbound_average(self):
"""
Returns the value of the `outbound_average` property.
"""
return self._outbound_average
@outbound_average.setter
def outbound_average(self, value):
"""
Sets the value of the `outbound_average` property.
"""
self._outbound_average = value
@property
def outbound_average_realtime(self):
"""
Returns the value of the `outbound_average_realtime` property.
"""
return self._outbound_average_realtime
@outbound_average_realtime.setter
def outbound_average_realtime(self, value):
"""
Sets the value of the `outbound_average_realtime` property.
"""
self._outbound_average_realtime = value
class Quota(Identified):
def __init__(
self,
cluster_hard_limit_pct=None,
cluster_soft_limit_pct=None,
comment=None,
data_center=None,
description=None,
disks=None,
id=None,
name=None,
permissions=None,
quota_cluster_limits=None,
quota_storage_limits=None,
storage_hard_limit_pct=None,
storage_soft_limit_pct=None,
users=None,
vms=None,
):
super(Quota, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster_hard_limit_pct = cluster_hard_limit_pct
self.cluster_soft_limit_pct = cluster_soft_limit_pct
self.data_center = data_center
self.disks = disks
self.permissions = permissions
self.quota_cluster_limits = quota_cluster_limits
self.quota_storage_limits = quota_storage_limits
self.storage_hard_limit_pct = storage_hard_limit_pct
self.storage_soft_limit_pct = storage_soft_limit_pct
self.users = users
self.vms = vms
@property
def users(self):
"""
Returns the value of the `users` property.
"""
return self._users
@users.setter
def users(self, value):
"""
Sets the value of the `users` property.
"""
self._users = value
@property
def storage_soft_limit_pct(self):
"""
Returns the value of the `storage_soft_limit_pct` property.
"""
return self._storage_soft_limit_pct
@storage_soft_limit_pct.setter
def storage_soft_limit_pct(self, value):
"""
Sets the value of the `storage_soft_limit_pct` property.
"""
self._storage_soft_limit_pct = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def quota_cluster_limits(self):
"""
Returns the value of the `quota_cluster_limits` property.
"""
return self._quota_cluster_limits
@quota_cluster_limits.setter
def quota_cluster_limits(self, value):
"""
Sets the value of the `quota_cluster_limits` property.
"""
self._quota_cluster_limits = value
@property
def cluster_hard_limit_pct(self):
"""
Returns the value of the `cluster_hard_limit_pct` property.
"""
return self._cluster_hard_limit_pct
@cluster_hard_limit_pct.setter
def cluster_hard_limit_pct(self, value):
"""
Sets the value of the `cluster_hard_limit_pct` property.
"""
self._cluster_hard_limit_pct = value
@property
def storage_hard_limit_pct(self):
"""
Returns the value of the `storage_hard_limit_pct` property.
"""
return self._storage_hard_limit_pct
@storage_hard_limit_pct.setter
def storage_hard_limit_pct(self, value):
"""
Sets the value of the `storage_hard_limit_pct` property.
"""
self._storage_hard_limit_pct = value
@property
def disks(self):
"""
Returns the value of the `disks` property.
"""
return self._disks
@disks.setter
def disks(self, value):
"""
Sets the value of the `disks` property.
"""
self._disks = value
@property
def cluster_soft_limit_pct(self):
"""
Returns the value of the `cluster_soft_limit_pct` property.
"""
return self._cluster_soft_limit_pct
@cluster_soft_limit_pct.setter
def cluster_soft_limit_pct(self, value):
"""
Sets the value of the `cluster_soft_limit_pct` property.
"""
self._cluster_soft_limit_pct = value
@property
def vms(self):
"""
Returns the value of the `vms` property.
"""
return self._vms
@vms.setter
def vms(self, value):
"""
Sets the value of the `vms` property.
"""
self._vms = value
@property
def quota_storage_limits(self):
"""
Returns the value of the `quota_storage_limits` property.
"""
return self._quota_storage_limits
@quota_storage_limits.setter
def quota_storage_limits(self, value):
"""
Sets the value of the `quota_storage_limits` property.
"""
self._quota_storage_limits = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
class QuotaClusterLimit(Identified):
def __init__(
self,
cluster=None,
comment=None,
description=None,
id=None,
memory_limit=None,
memory_usage=None,
name=None,
quota=None,
vcpu_limit=None,
vcpu_usage=None,
):
super(QuotaClusterLimit, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster = cluster
self.memory_limit = memory_limit
self.memory_usage = memory_usage
self.quota = quota
self.vcpu_limit = vcpu_limit
self.vcpu_usage = vcpu_usage
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def memory_limit(self):
"""
Returns the value of the `memory_limit` property.
"""
return self._memory_limit
@memory_limit.setter
def memory_limit(self, value):
"""
Sets the value of the `memory_limit` property.
"""
self._memory_limit = value
@property
def vcpu_usage(self):
"""
Returns the value of the `vcpu_usage` property.
"""
return self._vcpu_usage
@vcpu_usage.setter
def vcpu_usage(self, value):
"""
Sets the value of the `vcpu_usage` property.
"""
self._vcpu_usage = value
@property
def quota(self):
"""
Returns the value of the `quota` property.
"""
return self._quota
@quota.setter
def quota(self, value):
"""
Sets the value of the `quota` property.
"""
Struct._check_type('quota', value, Quota)
self._quota = value
@property
def vcpu_limit(self):
"""
Returns the value of the `vcpu_limit` property.
"""
return self._vcpu_limit
@vcpu_limit.setter
def vcpu_limit(self, value):
"""
Sets the value of the `vcpu_limit` property.
"""
self._vcpu_limit = value
@property
def memory_usage(self):
"""
Returns the value of the `memory_usage` property.
"""
return self._memory_usage
@memory_usage.setter
def memory_usage(self, value):
"""
Sets the value of the `memory_usage` property.
"""
self._memory_usage = value
class QuotaStorageLimit(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
limit=None,
name=None,
quota=None,
storage_domain=None,
usage=None,
):
super(QuotaStorageLimit, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.limit = limit
self.quota = quota
self.storage_domain = storage_domain
self.usage = usage
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def usage(self):
"""
Returns the value of the `usage` property.
"""
return self._usage
@usage.setter
def usage(self, value):
"""
Sets the value of the `usage` property.
"""
self._usage = value
@property
def quota(self):
"""
Returns the value of the `quota` property.
"""
return self._quota
@quota.setter
def quota(self, value):
"""
Sets the value of the `quota` property.
"""
Struct._check_type('quota', value, Quota)
self._quota = value
@property
def limit(self):
"""
Returns the value of the `limit` property.
"""
return self._limit
@limit.setter
def limit(self, value):
"""
Sets the value of the `limit` property.
"""
self._limit = value
class Range(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(Range, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
self._to = value
class Rate(Struct):
def __init__(
self,
bytes=None,
period=None,
):
super(Rate, self).__init__(
)
self.bytes = bytes
self.period = period
@property
def period(self):
"""
Returns the value of the `period` property.
"""
return self._period
@period.setter
def period(self, value):
"""
Sets the value of the `period` property.
"""
self._period = value
@property
def bytes(self):
"""
Returns the value of the `bytes` property.
"""
return self._bytes
@bytes.setter
def bytes(self, value):
"""
Sets the value of the `bytes` property.
"""
self._bytes = value
class RegistrationAffinityGroupMapping(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(RegistrationAffinityGroupMapping, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
Struct._check_type('from_', value, AffinityGroup)
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
Struct._check_type('to', value, AffinityGroup)
self._to = value
class RegistrationAffinityLabelMapping(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(RegistrationAffinityLabelMapping, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
Struct._check_type('from_', value, AffinityLabel)
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
Struct._check_type('to', value, AffinityLabel)
self._to = value
class RegistrationClusterMapping(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(RegistrationClusterMapping, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
Struct._check_type('from_', value, Cluster)
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
Struct._check_type('to', value, Cluster)
self._to = value
class RegistrationConfiguration(Struct):
def __init__(
self,
affinity_group_mappings=None,
affinity_label_mappings=None,
cluster_mappings=None,
domain_mappings=None,
lun_mappings=None,
role_mappings=None,
vnic_profile_mappings=None,
):
super(RegistrationConfiguration, self).__init__(
)
self.affinity_group_mappings = affinity_group_mappings
self.affinity_label_mappings = affinity_label_mappings
self.cluster_mappings = cluster_mappings
self.domain_mappings = domain_mappings
self.lun_mappings = lun_mappings
self.role_mappings = role_mappings
self.vnic_profile_mappings = vnic_profile_mappings
@property
def role_mappings(self):
"""
Returns the value of the `role_mappings` property.
"""
return self._role_mappings
@role_mappings.setter
def role_mappings(self, value):
"""
Sets the value of the `role_mappings` property.
"""
self._role_mappings = value
@property
def affinity_label_mappings(self):
"""
Returns the value of the `affinity_label_mappings` property.
"""
return self._affinity_label_mappings
@affinity_label_mappings.setter
def affinity_label_mappings(self, value):
"""
Sets the value of the `affinity_label_mappings` property.
"""
self._affinity_label_mappings = value
@property
def cluster_mappings(self):
"""
Returns the value of the `cluster_mappings` property.
"""
return self._cluster_mappings
@cluster_mappings.setter
def cluster_mappings(self, value):
"""
Sets the value of the `cluster_mappings` property.
"""
self._cluster_mappings = value
@property
def lun_mappings(self):
"""
Returns the value of the `lun_mappings` property.
"""
return self._lun_mappings
@lun_mappings.setter
def lun_mappings(self, value):
"""
Sets the value of the `lun_mappings` property.
"""
self._lun_mappings = value
@property
def vnic_profile_mappings(self):
"""
Returns the value of the `vnic_profile_mappings` property.
"""
return self._vnic_profile_mappings
@vnic_profile_mappings.setter
def vnic_profile_mappings(self, value):
"""
Sets the value of the `vnic_profile_mappings` property.
"""
self._vnic_profile_mappings = value
@property
def affinity_group_mappings(self):
"""
Returns the value of the `affinity_group_mappings` property.
"""
return self._affinity_group_mappings
@affinity_group_mappings.setter
def affinity_group_mappings(self, value):
"""
Sets the value of the `affinity_group_mappings` property.
"""
self._affinity_group_mappings = value
@property
def domain_mappings(self):
"""
Returns the value of the `domain_mappings` property.
"""
return self._domain_mappings
@domain_mappings.setter
def domain_mappings(self, value):
"""
Sets the value of the `domain_mappings` property.
"""
self._domain_mappings = value
class RegistrationDomainMapping(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(RegistrationDomainMapping, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
Struct._check_type('from_', value, Domain)
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
Struct._check_type('to', value, Domain)
self._to = value
class RegistrationLunMapping(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(RegistrationLunMapping, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
Struct._check_type('from_', value, Disk)
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
Struct._check_type('to', value, Disk)
self._to = value
class RegistrationRoleMapping(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(RegistrationRoleMapping, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
Struct._check_type('from_', value, Role)
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
Struct._check_type('to', value, Role)
self._to = value
class RegistrationVnicProfileMapping(Struct):
def __init__(
self,
from_=None,
to=None,
):
super(RegistrationVnicProfileMapping, self).__init__(
)
self.from_ = from_
self.to = to
@property
def from_(self):
"""
Returns the value of the `from_` property.
"""
return self._from_
@from_.setter
def from_(self, value):
"""
Sets the value of the `from_` property.
"""
Struct._check_type('from_', value, VnicProfile)
self._from_ = value
@property
def to(self):
"""
Returns the value of the `to` property.
"""
return self._to
@to.setter
def to(self, value):
"""
Sets the value of the `to` property.
"""
Struct._check_type('to', value, VnicProfile)
self._to = value
class ReportedConfiguration(Struct):
def __init__(
self,
actual_value=None,
expected_value=None,
in_sync=None,
name=None,
):
super(ReportedConfiguration, self).__init__(
)
self.actual_value = actual_value
self.expected_value = expected_value
self.in_sync = in_sync
self.name = name
@property
def in_sync(self):
"""
Returns the value of the `in_sync` property.
"""
return self._in_sync
@in_sync.setter
def in_sync(self, value):
"""
Sets the value of the `in_sync` property.
"""
self._in_sync = value
@property
def actual_value(self):
"""
Returns the value of the `actual_value` property.
"""
return self._actual_value
@actual_value.setter
def actual_value(self, value):
"""
Sets the value of the `actual_value` property.
"""
self._actual_value = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def expected_value(self):
"""
Returns the value of the `expected_value` property.
"""
return self._expected_value
@expected_value.setter
def expected_value(self, value):
"""
Sets the value of the `expected_value` property.
"""
self._expected_value = value
class ReportedDevice(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
ips=None,
mac=None,
name=None,
type=None,
vm=None,
):
super(ReportedDevice, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.ips = ips
self.mac = mac
self.type = type
self.vm = vm
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def ips(self):
"""
Returns the value of the `ips` property.
"""
return self._ips
@ips.setter
def ips(self, value):
"""
Sets the value of the `ips` property.
"""
self._ips = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, ReportedDeviceType)
self._type = value
@property
def mac(self):
"""
Returns the value of the `mac` property.
"""
return self._mac
@mac.setter
def mac(self, value):
"""
Sets the value of the `mac` property.
"""
Struct._check_type('mac', value, Mac)
self._mac = value
class RngDevice(Struct):
def __init__(
self,
rate=None,
source=None,
):
super(RngDevice, self).__init__(
)
self.rate = rate
self.source = source
@property
def rate(self):
"""
Returns the value of the `rate` property.
"""
return self._rate
@rate.setter
def rate(self, value):
"""
Sets the value of the `rate` property.
"""
Struct._check_type('rate', value, Rate)
self._rate = value
@property
def source(self):
"""
Returns the value of the `source` property.
"""
return self._source
@source.setter
def source(self, value):
"""
Sets the value of the `source` property.
"""
Struct._check_type('source', value, RngSource)
self._source = value
class Role(Identified):
def __init__(
self,
administrative=None,
comment=None,
description=None,
id=None,
mutable=None,
name=None,
permits=None,
user=None,
):
super(Role, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.administrative = administrative
self.mutable = mutable
self.permits = permits
self.user = user
@property
def administrative(self):
"""
Returns the value of the `administrative` property.
"""
return self._administrative
@administrative.setter
def administrative(self, value):
"""
Sets the value of the `administrative` property.
"""
self._administrative = value
@property
def mutable(self):
"""
Returns the value of the `mutable` property.
"""
return self._mutable
@mutable.setter
def mutable(self, value):
"""
Sets the value of the `mutable` property.
"""
self._mutable = value
@property
def permits(self):
"""
Returns the value of the `permits` property.
"""
return self._permits
@permits.setter
def permits(self, value):
"""
Sets the value of the `permits` property.
"""
self._permits = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
class SchedulingPolicy(Identified):
def __init__(
self,
balances=None,
comment=None,
default_policy=None,
description=None,
filters=None,
id=None,
locked=None,
name=None,
properties=None,
weight=None,
):
super(SchedulingPolicy, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.balances = balances
self.default_policy = default_policy
self.filters = filters
self.locked = locked
self.properties = properties
self.weight = weight
@property
def balances(self):
"""
Returns the value of the `balances` property.
"""
return self._balances
@balances.setter
def balances(self, value):
"""
Sets the value of the `balances` property.
"""
self._balances = value
@property
def default_policy(self):
"""
Returns the value of the `default_policy` property.
"""
return self._default_policy
@default_policy.setter
def default_policy(self, value):
"""
Sets the value of the `default_policy` property.
"""
self._default_policy = value
@property
def weight(self):
"""
Returns the value of the `weight` property.
"""
return self._weight
@weight.setter
def weight(self, value):
"""
Sets the value of the `weight` property.
"""
self._weight = value
@property
def filters(self):
"""
Returns the value of the `filters` property.
"""
return self._filters
@filters.setter
def filters(self, value):
"""
Sets the value of the `filters` property.
"""
self._filters = value
@property
def locked(self):
"""
Returns the value of the `locked` property.
"""
return self._locked
@locked.setter
def locked(self, value):
"""
Sets the value of the `locked` property.
"""
self._locked = value
@property
def properties(self):
"""
Returns the value of the `properties` property.
"""
return self._properties
@properties.setter
def properties(self, value):
"""
Sets the value of the `properties` property.
"""
self._properties = value
class SchedulingPolicyUnit(Identified):
def __init__(
self,
comment=None,
description=None,
enabled=None,
id=None,
internal=None,
name=None,
properties=None,
type=None,
):
super(SchedulingPolicyUnit, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.enabled = enabled
self.internal = internal
self.properties = properties
self.type = type
@property
def internal(self):
"""
Returns the value of the `internal` property.
"""
return self._internal
@internal.setter
def internal(self, value):
"""
Sets the value of the `internal` property.
"""
self._internal = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, PolicyUnitType)
self._type = value
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
@property
def properties(self):
"""
Returns the value of the `properties` property.
"""
return self._properties
@properties.setter
def properties(self, value):
"""
Sets the value of the `properties` property.
"""
self._properties = value
class SeLinux(Struct):
def __init__(
self,
mode=None,
):
super(SeLinux, self).__init__(
)
self.mode = mode
@property
def mode(self):
"""
Returns the value of the `mode` property.
"""
return self._mode
@mode.setter
def mode(self, value):
"""
Sets the value of the `mode` property.
"""
Struct._check_type('mode', value, SeLinuxMode)
self._mode = value
class SerialNumber(Struct):
def __init__(
self,
policy=None,
value=None,
):
super(SerialNumber, self).__init__(
)
self.policy = policy
self.value = value
@property
def policy(self):
"""
Returns the value of the `policy` property.
"""
return self._policy
@policy.setter
def policy(self, value):
"""
Sets the value of the `policy` property.
"""
Struct._check_type('policy', value, SerialNumberPolicy)
self._policy = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class Session(Identified):
def __init__(
self,
comment=None,
console_user=None,
description=None,
id=None,
ip=None,
name=None,
protocol=None,
user=None,
vm=None,
):
super(Session, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.console_user = console_user
self.ip = ip
self.protocol = protocol
self.user = user
self.vm = vm
@property
def ip(self):
"""
Returns the value of the `ip` property.
"""
return self._ip
@ip.setter
def ip(self, value):
"""
Sets the value of the `ip` property.
"""
Struct._check_type('ip', value, Ip)
self._ip = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def console_user(self):
"""
Returns the value of the `console_user` property.
"""
return self._console_user
@console_user.setter
def console_user(self, value):
"""
Sets the value of the `console_user` property.
"""
self._console_user = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def protocol(self):
"""
Returns the value of the `protocol` property.
"""
return self._protocol
@protocol.setter
def protocol(self, value):
"""
Sets the value of the `protocol` property.
"""
self._protocol = value
class SkipIfConnectivityBroken(Struct):
def __init__(
self,
enabled=None,
threshold=None,
):
super(SkipIfConnectivityBroken, self).__init__(
)
self.enabled = enabled
self.threshold = threshold
@property
def threshold(self):
"""
Returns the value of the `threshold` property.
"""
return self._threshold
@threshold.setter
def threshold(self, value):
"""
Sets the value of the `threshold` property.
"""
self._threshold = value
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class SkipIfSdActive(Struct):
def __init__(
self,
enabled=None,
):
super(SkipIfSdActive, self).__init__(
)
self.enabled = enabled
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class SpecialObjects(Struct):
def __init__(
self,
blank_template=None,
root_tag=None,
):
super(SpecialObjects, self).__init__(
)
self.blank_template = blank_template
self.root_tag = root_tag
@property
def blank_template(self):
"""
Returns the value of the `blank_template` property.
"""
return self._blank_template
@blank_template.setter
def blank_template(self, value):
"""
Sets the value of the `blank_template` property.
"""
Struct._check_type('blank_template', value, Template)
self._blank_template = value
@property
def root_tag(self):
"""
Returns the value of the `root_tag` property.
"""
return self._root_tag
@root_tag.setter
def root_tag(self, value):
"""
Sets the value of the `root_tag` property.
"""
Struct._check_type('root_tag', value, Tag)
self._root_tag = value
class Spm(Struct):
def __init__(
self,
priority=None,
status=None,
):
super(Spm, self).__init__(
)
self.priority = priority
self.status = status
@property
def priority(self):
"""
Returns the value of the `priority` property.
"""
return self._priority
@priority.setter
def priority(self, value):
"""
Sets the value of the `priority` property.
"""
self._priority = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, SpmStatus)
self._status = value
class Ssh(Identified):
def __init__(
self,
authentication_method=None,
comment=None,
description=None,
fingerprint=None,
id=None,
name=None,
port=None,
public_key=None,
user=None,
):
super(Ssh, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.authentication_method = authentication_method
self.fingerprint = fingerprint
self.port = port
self.public_key = public_key
self.user = user
@property
def authentication_method(self):
"""
Returns the value of the `authentication_method` property.
"""
return self._authentication_method
@authentication_method.setter
def authentication_method(self, value):
"""
Sets the value of the `authentication_method` property.
"""
Struct._check_type('authentication_method', value, SshAuthenticationMethod)
self._authentication_method = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def public_key(self):
"""
Returns the value of the `public_key` property.
"""
return self._public_key
@public_key.setter
def public_key(self, value):
"""
Sets the value of the `public_key` property.
"""
self._public_key = value
@property
def fingerprint(self):
"""
Returns the value of the `fingerprint` property.
"""
return self._fingerprint
@fingerprint.setter
def fingerprint(self, value):
"""
Sets the value of the `fingerprint` property.
"""
self._fingerprint = value
class SshPublicKey(Identified):
def __init__(
self,
comment=None,
content=None,
description=None,
id=None,
name=None,
user=None,
):
super(SshPublicKey, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.content = content
self.user = user
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def content(self):
"""
Returns the value of the `content` property.
"""
return self._content
@content.setter
def content(self, value):
"""
Sets the value of the `content` property.
"""
self._content = value
class Sso(Struct):
def __init__(
self,
methods=None,
):
super(Sso, self).__init__(
)
self.methods = methods
@property
def methods(self):
"""
Returns the value of the `methods` property.
"""
return self._methods
@methods.setter
def methods(self, value):
"""
Sets the value of the `methods` property.
"""
self._methods = value
class Statistic(Identified):
def __init__(
self,
brick=None,
comment=None,
description=None,
disk=None,
gluster_volume=None,
host=None,
host_nic=None,
host_numa_node=None,
id=None,
kind=None,
name=None,
nic=None,
step=None,
type=None,
unit=None,
values=None,
vm=None,
):
super(Statistic, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.brick = brick
self.disk = disk
self.gluster_volume = gluster_volume
self.host = host
self.host_nic = host_nic
self.host_numa_node = host_numa_node
self.kind = kind
self.nic = nic
self.step = step
self.type = type
self.unit = unit
self.values = values
self.vm = vm
@property
def kind(self):
"""
Returns the value of the `kind` property.
"""
return self._kind
@kind.setter
def kind(self, value):
"""
Sets the value of the `kind` property.
"""
Struct._check_type('kind', value, StatisticKind)
self._kind = value
@property
def values(self):
"""
Returns the value of the `values` property.
"""
return self._values
@values.setter
def values(self, value):
"""
Sets the value of the `values` property.
"""
self._values = value
@property
def nic(self):
"""
Returns the value of the `nic` property.
"""
return self._nic
@nic.setter
def nic(self, value):
"""
Sets the value of the `nic` property.
"""
Struct._check_type('nic', value, Nic)
self._nic = value
@property
def gluster_volume(self):
"""
Returns the value of the `gluster_volume` property.
"""
return self._gluster_volume
@gluster_volume.setter
def gluster_volume(self, value):
"""
Sets the value of the `gluster_volume` property.
"""
Struct._check_type('gluster_volume', value, GlusterVolume)
self._gluster_volume = value
@property
def host_numa_node(self):
"""
Returns the value of the `host_numa_node` property.
"""
return self._host_numa_node
@host_numa_node.setter
def host_numa_node(self, value):
"""
Sets the value of the `host_numa_node` property.
"""
Struct._check_type('host_numa_node', value, NumaNode)
self._host_numa_node = value
@property
def host_nic(self):
"""
Returns the value of the `host_nic` property.
"""
return self._host_nic
@host_nic.setter
def host_nic(self, value):
"""
Sets the value of the `host_nic` property.
"""
Struct._check_type('host_nic', value, HostNic)
self._host_nic = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, ValueType)
self._type = value
@property
def disk(self):
"""
Returns the value of the `disk` property.
"""
return self._disk
@disk.setter
def disk(self, value):
"""
Sets the value of the `disk` property.
"""
Struct._check_type('disk', value, Disk)
self._disk = value
@property
def unit(self):
"""
Returns the value of the `unit` property.
"""
return self._unit
@unit.setter
def unit(self, value):
"""
Sets the value of the `unit` property.
"""
Struct._check_type('unit', value, StatisticUnit)
self._unit = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def brick(self):
"""
Returns the value of the `brick` property.
"""
return self._brick
@brick.setter
def brick(self, value):
"""
Sets the value of the `brick` property.
"""
Struct._check_type('brick', value, GlusterBrick)
self._brick = value
@property
def step(self):
"""
Returns the value of the `step` property.
"""
return self._step
@step.setter
def step(self, value):
"""
Sets the value of the `step` property.
"""
Struct._check_type('step', value, Step)
self._step = value
class Step(Identified):
def __init__(
self,
comment=None,
description=None,
end_time=None,
execution_host=None,
external=None,
external_type=None,
id=None,
job=None,
name=None,
number=None,
parent_step=None,
progress=None,
start_time=None,
statistics=None,
status=None,
type=None,
):
super(Step, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.end_time = end_time
self.execution_host = execution_host
self.external = external
self.external_type = external_type
self.job = job
self.number = number
self.parent_step = parent_step
self.progress = progress
self.start_time = start_time
self.statistics = statistics
self.status = status
self.type = type
@property
def number(self):
"""
Returns the value of the `number` property.
"""
return self._number
@number.setter
def number(self, value):
"""
Sets the value of the `number` property.
"""
self._number = value
@property
def external(self):
"""
Returns the value of the `external` property.
"""
return self._external
@external.setter
def external(self, value):
"""
Sets the value of the `external` property.
"""
self._external = value
@property
def end_time(self):
"""
Returns the value of the `end_time` property.
"""
return self._end_time
@end_time.setter
def end_time(self, value):
"""
Sets the value of the `end_time` property.
"""
self._end_time = value
@property
def start_time(self):
"""
Returns the value of the `start_time` property.
"""
return self._start_time
@start_time.setter
def start_time(self, value):
"""
Sets the value of the `start_time` property.
"""
self._start_time = value
@property
def progress(self):
"""
Returns the value of the `progress` property.
"""
return self._progress
@progress.setter
def progress(self, value):
"""
Sets the value of the `progress` property.
"""
self._progress = value
@property
def execution_host(self):
"""
Returns the value of the `execution_host` property.
"""
return self._execution_host
@execution_host.setter
def execution_host(self, value):
"""
Sets the value of the `execution_host` property.
"""
Struct._check_type('execution_host', value, Host)
self._execution_host = value
@property
def external_type(self):
"""
Returns the value of the `external_type` property.
"""
return self._external_type
@external_type.setter
def external_type(self, value):
"""
Sets the value of the `external_type` property.
"""
Struct._check_type('external_type', value, ExternalSystemType)
self._external_type = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, StepStatus)
self._status = value
@property
def job(self):
"""
Returns the value of the `job` property.
"""
return self._job
@job.setter
def job(self, value):
"""
Sets the value of the `job` property.
"""
Struct._check_type('job', value, Job)
self._job = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, StepEnum)
self._type = value
@property
def parent_step(self):
"""
Returns the value of the `parent_step` property.
"""
return self._parent_step
@parent_step.setter
def parent_step(self, value):
"""
Sets the value of the `parent_step` property.
"""
Struct._check_type('parent_step', value, Step)
self._parent_step = value
class StorageConnection(Identified):
def __init__(
self,
address=None,
comment=None,
description=None,
gluster_volume=None,
host=None,
id=None,
mount_options=None,
name=None,
nfs_retrans=None,
nfs_timeo=None,
nfs_version=None,
password=None,
path=None,
port=None,
portal=None,
target=None,
type=None,
username=None,
vfs_type=None,
):
super(StorageConnection, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.address = address
self.gluster_volume = gluster_volume
self.host = host
self.mount_options = mount_options
self.nfs_retrans = nfs_retrans
self.nfs_timeo = nfs_timeo
self.nfs_version = nfs_version
self.password = password
self.path = path
self.port = port
self.portal = portal
self.target = target
self.type = type
self.username = username
self.vfs_type = vfs_type
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def gluster_volume(self):
"""
Returns the value of the `gluster_volume` property.
"""
return self._gluster_volume
@gluster_volume.setter
def gluster_volume(self, value):
"""
Sets the value of the `gluster_volume` property.
"""
Struct._check_type('gluster_volume', value, GlusterVolume)
self._gluster_volume = value
@property
def target(self):
"""
Returns the value of the `target` property.
"""
return self._target
@target.setter
def target(self, value):
"""
Sets the value of the `target` property.
"""
self._target = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, StorageType)
self._type = value
@property
def nfs_timeo(self):
"""
Returns the value of the `nfs_timeo` property.
"""
return self._nfs_timeo
@nfs_timeo.setter
def nfs_timeo(self, value):
"""
Sets the value of the `nfs_timeo` property.
"""
self._nfs_timeo = value
@property
def path(self):
"""
Returns the value of the `path` property.
"""
return self._path
@path.setter
def path(self, value):
"""
Sets the value of the `path` property.
"""
self._path = value
@property
def nfs_retrans(self):
"""
Returns the value of the `nfs_retrans` property.
"""
return self._nfs_retrans
@nfs_retrans.setter
def nfs_retrans(self, value):
"""
Sets the value of the `nfs_retrans` property.
"""
self._nfs_retrans = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def vfs_type(self):
"""
Returns the value of the `vfs_type` property.
"""
return self._vfs_type
@vfs_type.setter
def vfs_type(self, value):
"""
Sets the value of the `vfs_type` property.
"""
self._vfs_type = value
@property
def nfs_version(self):
"""
Returns the value of the `nfs_version` property.
"""
return self._nfs_version
@nfs_version.setter
def nfs_version(self, value):
"""
Sets the value of the `nfs_version` property.
"""
Struct._check_type('nfs_version', value, NfsVersion)
self._nfs_version = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def portal(self):
"""
Returns the value of the `portal` property.
"""
return self._portal
@portal.setter
def portal(self, value):
"""
Sets the value of the `portal` property.
"""
self._portal = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def mount_options(self):
"""
Returns the value of the `mount_options` property.
"""
return self._mount_options
@mount_options.setter
def mount_options(self, value):
"""
Sets the value of the `mount_options` property.
"""
self._mount_options = value
class StorageConnectionExtension(Identified):
def __init__(
self,
comment=None,
description=None,
host=None,
id=None,
name=None,
password=None,
target=None,
username=None,
):
super(StorageConnectionExtension, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.host = host
self.password = password
self.target = target
self.username = username
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def target(self):
"""
Returns the value of the `target` property.
"""
return self._target
@target.setter
def target(self, value):
"""
Sets the value of the `target` property.
"""
self._target = value
class StorageDomain(Identified):
def __init__(
self,
available=None,
backup=None,
block_size=None,
comment=None,
committed=None,
critical_space_action_blocker=None,
data_center=None,
data_centers=None,
description=None,
discard_after_delete=None,
disk_profiles=None,
disk_snapshots=None,
disks=None,
external_status=None,
files=None,
host=None,
id=None,
images=None,
import_=None,
master=None,
name=None,
permissions=None,
status=None,
storage=None,
storage_connections=None,
storage_format=None,
supports_discard=None,
supports_discard_zeroes_data=None,
templates=None,
type=None,
used=None,
vms=None,
warning_low_space_indicator=None,
wipe_after_delete=None,
):
super(StorageDomain, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.available = available
self.backup = backup
self.block_size = block_size
self.committed = committed
self.critical_space_action_blocker = critical_space_action_blocker
self.data_center = data_center
self.data_centers = data_centers
self.discard_after_delete = discard_after_delete
self.disk_profiles = disk_profiles
self.disk_snapshots = disk_snapshots
self.disks = disks
self.external_status = external_status
self.files = files
self.host = host
self.images = images
self.import_ = import_
self.master = master
self.permissions = permissions
self.status = status
self.storage = storage
self.storage_connections = storage_connections
self.storage_format = storage_format
self.supports_discard = supports_discard
self.supports_discard_zeroes_data = supports_discard_zeroes_data
self.templates = templates
self.type = type
self.used = used
self.vms = vms
self.warning_low_space_indicator = warning_low_space_indicator
self.wipe_after_delete = wipe_after_delete
@property
def data_centers(self):
"""
Returns the value of the `data_centers` property.
"""
return self._data_centers
@data_centers.setter
def data_centers(self, value):
"""
Sets the value of the `data_centers` property.
"""
self._data_centers = value
@property
def block_size(self):
"""
Returns the value of the `block_size` property.
"""
return self._block_size
@block_size.setter
def block_size(self, value):
"""
Sets the value of the `block_size` property.
"""
self._block_size = value
@property
def committed(self):
"""
Returns the value of the `committed` property.
"""
return self._committed
@committed.setter
def committed(self, value):
"""
Sets the value of the `committed` property.
"""
self._committed = value
@property
def warning_low_space_indicator(self):
"""
Returns the value of the `warning_low_space_indicator` property.
"""
return self._warning_low_space_indicator
@warning_low_space_indicator.setter
def warning_low_space_indicator(self, value):
"""
Sets the value of the `warning_low_space_indicator` property.
"""
self._warning_low_space_indicator = value
@property
def templates(self):
"""
Returns the value of the `templates` property.
"""
return self._templates
@templates.setter
def templates(self, value):
"""
Sets the value of the `templates` property.
"""
self._templates = value
@property
def external_status(self):
"""
Returns the value of the `external_status` property.
"""
return self._external_status
@external_status.setter
def external_status(self, value):
"""
Sets the value of the `external_status` property.
"""
Struct._check_type('external_status', value, ExternalStatus)
self._external_status = value
@property
def master(self):
"""
Returns the value of the `master` property.
"""
return self._master
@master.setter
def master(self, value):
"""
Sets the value of the `master` property.
"""
self._master = value
@property
def discard_after_delete(self):
"""
Returns the value of the `discard_after_delete` property.
"""
return self._discard_after_delete
@discard_after_delete.setter
def discard_after_delete(self, value):
"""
Sets the value of the `discard_after_delete` property.
"""
self._discard_after_delete = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def images(self):
"""
Returns the value of the `images` property.
"""
return self._images
@images.setter
def images(self, value):
"""
Sets the value of the `images` property.
"""
self._images = value
@property
def supports_discard_zeroes_data(self):
"""
Returns the value of the `supports_discard_zeroes_data` property.
"""
return self._supports_discard_zeroes_data
@supports_discard_zeroes_data.setter
def supports_discard_zeroes_data(self, value):
"""
Sets the value of the `supports_discard_zeroes_data` property.
"""
self._supports_discard_zeroes_data = value
@property
def files(self):
"""
Returns the value of the `files` property.
"""
return self._files
@files.setter
def files(self, value):
"""
Sets the value of the `files` property.
"""
self._files = value
@property
def storage_connections(self):
"""
Returns the value of the `storage_connections` property.
"""
return self._storage_connections
@storage_connections.setter
def storage_connections(self, value):
"""
Sets the value of the `storage_connections` property.
"""
self._storage_connections = value
@property
def disk_profiles(self):
"""
Returns the value of the `disk_profiles` property.
"""
return self._disk_profiles
@disk_profiles.setter
def disk_profiles(self, value):
"""
Sets the value of the `disk_profiles` property.
"""
self._disk_profiles = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, StorageDomainStatus)
self._status = value
@property
def backup(self):
"""
Returns the value of the `backup` property.
"""
return self._backup
@backup.setter
def backup(self, value):
"""
Sets the value of the `backup` property.
"""
self._backup = value
@property
def disk_snapshots(self):
"""
Returns the value of the `disk_snapshots` property.
"""
return self._disk_snapshots
@disk_snapshots.setter
def disk_snapshots(self, value):
"""
Sets the value of the `disk_snapshots` property.
"""
self._disk_snapshots = value
@property
def storage_format(self):
"""
Returns the value of the `storage_format` property.
"""
return self._storage_format
@storage_format.setter
def storage_format(self, value):
"""
Sets the value of the `storage_format` property.
"""
Struct._check_type('storage_format', value, StorageFormat)
self._storage_format = value
@property
def import_(self):
"""
Returns the value of the `import_` property.
"""
return self._import_
@import_.setter
def import_(self, value):
"""
Sets the value of the `import_` property.
"""
self._import_ = value
@property
def disks(self):
"""
Returns the value of the `disks` property.
"""
return self._disks
@disks.setter
def disks(self, value):
"""
Sets the value of the `disks` property.
"""
self._disks = value
@property
def available(self):
"""
Returns the value of the `available` property.
"""
return self._available
@available.setter
def available(self, value):
"""
Sets the value of the `available` property.
"""
self._available = value
@property
def storage(self):
"""
Returns the value of the `storage` property.
"""
return self._storage
@storage.setter
def storage(self, value):
"""
Sets the value of the `storage` property.
"""
Struct._check_type('storage', value, HostStorage)
self._storage = value
@property
def used(self):
"""
Returns the value of the `used` property.
"""
return self._used
@used.setter
def used(self, value):
"""
Sets the value of the `used` property.
"""
self._used = value
@property
def supports_discard(self):
"""
Returns the value of the `supports_discard` property.
"""
return self._supports_discard
@supports_discard.setter
def supports_discard(self, value):
"""
Sets the value of the `supports_discard` property.
"""
self._supports_discard = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, StorageDomainType)
self._type = value
@property
def critical_space_action_blocker(self):
"""
Returns the value of the `critical_space_action_blocker` property.
"""
return self._critical_space_action_blocker
@critical_space_action_blocker.setter
def critical_space_action_blocker(self, value):
"""
Sets the value of the `critical_space_action_blocker` property.
"""
self._critical_space_action_blocker = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def wipe_after_delete(self):
"""
Returns the value of the `wipe_after_delete` property.
"""
return self._wipe_after_delete
@wipe_after_delete.setter
def wipe_after_delete(self, value):
"""
Sets the value of the `wipe_after_delete` property.
"""
self._wipe_after_delete = value
@property
def vms(self):
"""
Returns the value of the `vms` property.
"""
return self._vms
@vms.setter
def vms(self, value):
"""
Sets the value of the `vms` property.
"""
self._vms = value
class StorageDomainLease(Struct):
def __init__(
self,
storage_domain=None,
):
super(StorageDomainLease, self).__init__(
)
self.storage_domain = storage_domain
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
class SystemOption(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
values=None,
):
super(SystemOption, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.values = values
@property
def values(self):
"""
Returns the value of the `values` property.
"""
return self._values
@values.setter
def values(self, value):
"""
Sets the value of the `values` property.
"""
self._values = value
class SystemOptionValue(Struct):
def __init__(
self,
value=None,
version=None,
):
super(SystemOptionValue, self).__init__(
)
self.value = value
self.version = version
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
self._version = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class Tag(Identified):
def __init__(
self,
comment=None,
description=None,
group=None,
host=None,
id=None,
name=None,
parent=None,
template=None,
user=None,
vm=None,
):
super(Tag, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.group = group
self.host = host
self.parent = parent
self.template = template
self.user = user
self.vm = vm
@property
def parent(self):
"""
Returns the value of the `parent` property.
"""
return self._parent
@parent.setter
def parent(self, value):
"""
Sets the value of the `parent` property.
"""
Struct._check_type('parent', value, Tag)
self._parent = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def group(self):
"""
Returns the value of the `group` property.
"""
return self._group
@group.setter
def group(self, value):
"""
Sets the value of the `group` property.
"""
Struct._check_type('group', value, Group)
self._group = value
class TemplateVersion(Struct):
def __init__(
self,
base_template=None,
version_name=None,
version_number=None,
):
super(TemplateVersion, self).__init__(
)
self.base_template = base_template
self.version_name = version_name
self.version_number = version_number
@property
def version_number(self):
"""
Returns the value of the `version_number` property.
"""
return self._version_number
@version_number.setter
def version_number(self, value):
"""
Sets the value of the `version_number` property.
"""
self._version_number = value
@property
def version_name(self):
"""
Returns the value of the `version_name` property.
"""
return self._version_name
@version_name.setter
def version_name(self, value):
"""
Sets the value of the `version_name` property.
"""
self._version_name = value
@property
def base_template(self):
"""
Returns the value of the `base_template` property.
"""
return self._base_template
@base_template.setter
def base_template(self, value):
"""
Sets the value of the `base_template` property.
"""
Struct._check_type('base_template', value, Template)
self._base_template = value
class Ticket(Struct):
def __init__(
self,
expiry=None,
value=None,
):
super(Ticket, self).__init__(
)
self.expiry = expiry
self.value = value
@property
def expiry(self):
"""
Returns the value of the `expiry` property.
"""
return self._expiry
@expiry.setter
def expiry(self, value):
"""
Sets the value of the `expiry` property.
"""
self._expiry = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class TimeZone(Struct):
def __init__(
self,
name=None,
utc_offset=None,
):
super(TimeZone, self).__init__(
)
self.name = name
self.utc_offset = utc_offset
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def utc_offset(self):
"""
Returns the value of the `utc_offset` property.
"""
return self._utc_offset
@utc_offset.setter
def utc_offset(self, value):
"""
Sets the value of the `utc_offset` property.
"""
self._utc_offset = value
class TransparentHugePages(Struct):
def __init__(
self,
enabled=None,
):
super(TransparentHugePages, self).__init__(
)
self.enabled = enabled
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class UnmanagedNetwork(Identified):
def __init__(
self,
comment=None,
description=None,
host=None,
host_nic=None,
id=None,
name=None,
):
super(UnmanagedNetwork, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.host = host
self.host_nic = host_nic
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def host_nic(self):
"""
Returns the value of the `host_nic` property.
"""
return self._host_nic
@host_nic.setter
def host_nic(self, value):
"""
Sets the value of the `host_nic` property.
"""
Struct._check_type('host_nic', value, HostNic)
self._host_nic = value
class Usb(Struct):
def __init__(
self,
enabled=None,
type=None,
):
super(Usb, self).__init__(
)
self.enabled = enabled
self.type = type
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, UsbType)
self._type = value
class User(Identified):
def __init__(
self,
comment=None,
department=None,
description=None,
domain=None,
domain_entry_id=None,
email=None,
groups=None,
id=None,
last_name=None,
logged_in=None,
name=None,
namespace=None,
options=None,
password=None,
permissions=None,
principal=None,
roles=None,
ssh_public_keys=None,
tags=None,
user_name=None,
user_options=None,
):
super(User, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.department = department
self.domain = domain
self.domain_entry_id = domain_entry_id
self.email = email
self.groups = groups
self.last_name = last_name
self.logged_in = logged_in
self.namespace = namespace
self.options = options
self.password = password
self.permissions = permissions
self.principal = principal
self.roles = roles
self.ssh_public_keys = ssh_public_keys
self.tags = tags
self.user_name = user_name
self.user_options = user_options
@property
def logged_in(self):
"""
Returns the value of the `logged_in` property.
"""
return self._logged_in
@logged_in.setter
def logged_in(self, value):
"""
Sets the value of the `logged_in` property.
"""
self._logged_in = value
@property
def last_name(self):
"""
Returns the value of the `last_name` property.
"""
return self._last_name
@last_name.setter
def last_name(self, value):
"""
Sets the value of the `last_name` property.
"""
self._last_name = value
@property
def roles(self):
"""
Returns the value of the `roles` property.
"""
return self._roles
@roles.setter
def roles(self, value):
"""
Sets the value of the `roles` property.
"""
self._roles = value
@property
def ssh_public_keys(self):
"""
Returns the value of the `ssh_public_keys` property.
"""
return self._ssh_public_keys
@ssh_public_keys.setter
def ssh_public_keys(self, value):
"""
Sets the value of the `ssh_public_keys` property.
"""
self._ssh_public_keys = value
@property
def groups(self):
"""
Returns the value of the `groups` property.
"""
return self._groups
@groups.setter
def groups(self, value):
"""
Sets the value of the `groups` property.
"""
self._groups = value
@property
def tags(self):
"""
Returns the value of the `tags` property.
"""
return self._tags
@tags.setter
def tags(self, value):
"""
Sets the value of the `tags` property.
"""
self._tags = value
@property
def domain(self):
"""
Returns the value of the `domain` property.
"""
return self._domain
@domain.setter
def domain(self, value):
"""
Sets the value of the `domain` property.
"""
Struct._check_type('domain', value, Domain)
self._domain = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def principal(self):
"""
Returns the value of the `principal` property.
"""
return self._principal
@principal.setter
def principal(self, value):
"""
Sets the value of the `principal` property.
"""
self._principal = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def namespace(self):
"""
Returns the value of the `namespace` property.
"""
return self._namespace
@namespace.setter
def namespace(self, value):
"""
Sets the value of the `namespace` property.
"""
self._namespace = value
@property
def email(self):
"""
Returns the value of the `email` property.
"""
return self._email
@email.setter
def email(self, value):
"""
Sets the value of the `email` property.
"""
self._email = value
@property
def user_options(self):
"""
Returns the value of the `user_options` property.
"""
return self._user_options
@user_options.setter
def user_options(self, value):
"""
Sets the value of the `user_options` property.
"""
self._user_options = value
@property
def user_name(self):
"""
Returns the value of the `user_name` property.
"""
return self._user_name
@user_name.setter
def user_name(self, value):
"""
Sets the value of the `user_name` property.
"""
self._user_name = value
@property
def options(self):
"""
Returns the value of the `options` property.
"""
return self._options
@options.setter
def options(self, value):
"""
Sets the value of the `options` property.
"""
self._options = value
@property
def domain_entry_id(self):
"""
Returns the value of the `domain_entry_id` property.
"""
return self._domain_entry_id
@domain_entry_id.setter
def domain_entry_id(self, value):
"""
Sets the value of the `domain_entry_id` property.
"""
self._domain_entry_id = value
@property
def department(self):
"""
Returns the value of the `department` property.
"""
return self._department
@department.setter
def department(self, value):
"""
Sets the value of the `department` property.
"""
self._department = value
class UserOption(Identified):
def __init__(
self,
comment=None,
content=None,
description=None,
id=None,
name=None,
user=None,
):
super(UserOption, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.content = content
self.user = user
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def content(self):
"""
Returns the value of the `content` property.
"""
return self._content
@content.setter
def content(self, value):
"""
Sets the value of the `content` property.
"""
self._content = value
class Value(Struct):
def __init__(
self,
datum=None,
detail=None,
):
super(Value, self).__init__(
)
self.datum = datum
self.detail = detail
@property
def datum(self):
"""
Returns the value of the `datum` property.
"""
return self._datum
@datum.setter
def datum(self, value):
"""
Sets the value of the `datum` property.
"""
self._datum = value
@property
def detail(self):
"""
Returns the value of the `detail` property.
"""
return self._detail
@detail.setter
def detail(self, value):
"""
Sets the value of the `detail` property.
"""
self._detail = value
class VcpuPin(Struct):
def __init__(
self,
cpu_set=None,
vcpu=None,
):
super(VcpuPin, self).__init__(
)
self.cpu_set = cpu_set
self.vcpu = vcpu
@property
def vcpu(self):
"""
Returns the value of the `vcpu` property.
"""
return self._vcpu
@vcpu.setter
def vcpu(self, value):
"""
Sets the value of the `vcpu` property.
"""
self._vcpu = value
@property
def cpu_set(self):
"""
Returns the value of the `cpu_set` property.
"""
return self._cpu_set
@cpu_set.setter
def cpu_set(self, value):
"""
Sets the value of the `cpu_set` property.
"""
self._cpu_set = value
class Vendor(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
):
super(Vendor, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
pass
class Version(Identified):
def __init__(
self,
build=None,
comment=None,
description=None,
full_version=None,
id=None,
major=None,
minor=None,
name=None,
revision=None,
):
super(Version, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.build = build
self.full_version = full_version
self.major = major
self.minor = minor
self.revision = revision
@property
def full_version(self):
"""
Returns the value of the `full_version` property.
"""
return self._full_version
@full_version.setter
def full_version(self, value):
"""
Sets the value of the `full_version` property.
"""
self._full_version = value
@property
def major(self):
"""
Returns the value of the `major` property.
"""
return self._major
@major.setter
def major(self, value):
"""
Sets the value of the `major` property.
"""
self._major = value
@property
def minor(self):
"""
Returns the value of the `minor` property.
"""
return self._minor
@minor.setter
def minor(self, value):
"""
Sets the value of the `minor` property.
"""
self._minor = value
@property
def build(self):
"""
Returns the value of the `build` property.
"""
return self._build
@build.setter
def build(self, value):
"""
Sets the value of the `build` property.
"""
self._build = value
@property
def revision(self):
"""
Returns the value of the `revision` property.
"""
return self._revision
@revision.setter
def revision(self, value):
"""
Sets the value of the `revision` property.
"""
self._revision = value
class VirtioScsi(Struct):
def __init__(
self,
enabled=None,
):
super(VirtioScsi, self).__init__(
)
self.enabled = enabled
@property
def enabled(self):
"""
Returns the value of the `enabled` property.
"""
return self._enabled
@enabled.setter
def enabled(self, value):
"""
Sets the value of the `enabled` property.
"""
self._enabled = value
class VirtualNumaNode(NumaNode):
def __init__(
self,
comment=None,
cpu=None,
description=None,
host=None,
id=None,
index=None,
memory=None,
name=None,
node_distance=None,
numa_node_pins=None,
numa_tune_mode=None,
statistics=None,
vm=None,
):
super(VirtualNumaNode, self).__init__(
comment=comment,
cpu=cpu,
description=description,
host=host,
id=id,
index=index,
memory=memory,
name=name,
node_distance=node_distance,
statistics=statistics,
)
self.numa_node_pins = numa_node_pins
self.numa_tune_mode = numa_tune_mode
self.vm = vm
@property
def numa_tune_mode(self):
"""
Returns the value of the `numa_tune_mode` property.
"""
return self._numa_tune_mode
@numa_tune_mode.setter
def numa_tune_mode(self, value):
"""
Sets the value of the `numa_tune_mode` property.
"""
Struct._check_type('numa_tune_mode', value, NumaTuneMode)
self._numa_tune_mode = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def numa_node_pins(self):
"""
Returns the value of the `numa_node_pins` property.
"""
return self._numa_node_pins
@numa_node_pins.setter
def numa_node_pins(self, value):
"""
Sets the value of the `numa_node_pins` property.
"""
self._numa_node_pins = value
class Vlan(Struct):
def __init__(
self,
id=None,
):
super(Vlan, self).__init__(
)
self.id = id
@property
def id(self):
"""
Returns the value of the `id` property.
"""
return self._id
@id.setter
def id(self, value):
"""
Sets the value of the `id` property.
"""
self._id = value
class VmBase(Identified):
def __init__(
self,
auto_pinning_policy=None,
bios=None,
cluster=None,
comment=None,
console=None,
cpu=None,
cpu_pinning_policy=None,
cpu_profile=None,
cpu_shares=None,
creation_time=None,
custom_compatibility_version=None,
custom_cpu_model=None,
custom_emulated_machine=None,
custom_properties=None,
delete_protected=None,
description=None,
display=None,
domain=None,
high_availability=None,
id=None,
initialization=None,
io=None,
large_icon=None,
lease=None,
memory=None,
memory_policy=None,
migration=None,
migration_downtime=None,
multi_queues_enabled=None,
name=None,
origin=None,
os=None,
placement_policy=None,
quota=None,
rng_device=None,
serial_number=None,
small_icon=None,
soundcard_enabled=None,
sso=None,
start_paused=None,
stateless=None,
storage_domain=None,
storage_error_resume_behaviour=None,
time_zone=None,
tpm_enabled=None,
tunnel_migration=None,
type=None,
usb=None,
virtio_scsi=None,
virtio_scsi_multi_queues=None,
virtio_scsi_multi_queues_enabled=None,
):
super(VmBase, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.auto_pinning_policy = auto_pinning_policy
self.bios = bios
self.cluster = cluster
self.console = console
self.cpu = cpu
self.cpu_pinning_policy = cpu_pinning_policy
self.cpu_profile = cpu_profile
self.cpu_shares = cpu_shares
self.creation_time = creation_time
self.custom_compatibility_version = custom_compatibility_version
self.custom_cpu_model = custom_cpu_model
self.custom_emulated_machine = custom_emulated_machine
self.custom_properties = custom_properties
self.delete_protected = delete_protected
self.display = display
self.domain = domain
self.high_availability = high_availability
self.initialization = initialization
self.io = io
self.large_icon = large_icon
self.lease = lease
self.memory = memory
self.memory_policy = memory_policy
self.migration = migration
self.migration_downtime = migration_downtime
self.multi_queues_enabled = multi_queues_enabled
self.origin = origin
self.os = os
self.placement_policy = placement_policy
self.quota = quota
self.rng_device = rng_device
self.serial_number = serial_number
self.small_icon = small_icon
self.soundcard_enabled = soundcard_enabled
self.sso = sso
self.start_paused = start_paused
self.stateless = stateless
self.storage_domain = storage_domain
self.storage_error_resume_behaviour = storage_error_resume_behaviour
self.time_zone = time_zone
self.tpm_enabled = tpm_enabled
self.tunnel_migration = tunnel_migration
self.type = type
self.usb = usb
self.virtio_scsi = virtio_scsi
self.virtio_scsi_multi_queues = virtio_scsi_multi_queues
self.virtio_scsi_multi_queues_enabled = virtio_scsi_multi_queues_enabled
@property
def delete_protected(self):
"""
Returns the value of the `delete_protected` property.
"""
return self._delete_protected
@delete_protected.setter
def delete_protected(self, value):
"""
Sets the value of the `delete_protected` property.
"""
self._delete_protected = value
@property
def high_availability(self):
"""
Returns the value of the `high_availability` property.
"""
return self._high_availability
@high_availability.setter
def high_availability(self, value):
"""
Sets the value of the `high_availability` property.
"""
Struct._check_type('high_availability', value, HighAvailability)
self._high_availability = value
@property
def console(self):
"""
Returns the value of the `console` property.
"""
return self._console
@console.setter
def console(self, value):
"""
Sets the value of the `console` property.
"""
Struct._check_type('console', value, Console)
self._console = value
@property
def serial_number(self):
"""
Returns the value of the `serial_number` property.
"""
return self._serial_number
@serial_number.setter
def serial_number(self, value):
"""
Sets the value of the `serial_number` property.
"""
Struct._check_type('serial_number', value, SerialNumber)
self._serial_number = value
@property
def os(self):
"""
Returns the value of the `os` property.
"""
return self._os
@os.setter
def os(self, value):
"""
Sets the value of the `os` property.
"""
Struct._check_type('os', value, OperatingSystem)
self._os = value
@property
def display(self):
"""
Returns the value of the `display` property.
"""
return self._display
@display.setter
def display(self, value):
"""
Sets the value of the `display` property.
"""
Struct._check_type('display', value, Display)
self._display = value
@property
def io(self):
"""
Returns the value of the `io` property.
"""
return self._io
@io.setter
def io(self, value):
"""
Sets the value of the `io` property.
"""
Struct._check_type('io', value, Io)
self._io = value
@property
def cpu(self):
"""
Returns the value of the `cpu` property.
"""
return self._cpu
@cpu.setter
def cpu(self, value):
"""
Sets the value of the `cpu` property.
"""
Struct._check_type('cpu', value, Cpu)
self._cpu = value
@property
def initialization(self):
"""
Returns the value of the `initialization` property.
"""
return self._initialization
@initialization.setter
def initialization(self, value):
"""
Sets the value of the `initialization` property.
"""
Struct._check_type('initialization', value, Initialization)
self._initialization = value
@property
def migration_downtime(self):
"""
Returns the value of the `migration_downtime` property.
"""
return self._migration_downtime
@migration_downtime.setter
def migration_downtime(self, value):
"""
Sets the value of the `migration_downtime` property.
"""
self._migration_downtime = value
@property
def time_zone(self):
"""
Returns the value of the `time_zone` property.
"""
return self._time_zone
@time_zone.setter
def time_zone(self, value):
"""
Sets the value of the `time_zone` property.
"""
Struct._check_type('time_zone', value, TimeZone)
self._time_zone = value
@property
def small_icon(self):
"""
Returns the value of the `small_icon` property.
"""
return self._small_icon
@small_icon.setter
def small_icon(self, value):
"""
Sets the value of the `small_icon` property.
"""
Struct._check_type('small_icon', value, Icon)
self._small_icon = value
@property
def domain(self):
"""
Returns the value of the `domain` property.
"""
return self._domain
@domain.setter
def domain(self, value):
"""
Sets the value of the `domain` property.
"""
Struct._check_type('domain', value, Domain)
self._domain = value
@property
def memory_policy(self):
"""
Returns the value of the `memory_policy` property.
"""
return self._memory_policy
@memory_policy.setter
def memory_policy(self, value):
"""
Sets the value of the `memory_policy` property.
"""
Struct._check_type('memory_policy', value, MemoryPolicy)
self._memory_policy = value
@property
def virtio_scsi(self):
"""
Returns the value of the `virtio_scsi` property.
"""
return self._virtio_scsi
@virtio_scsi.setter
def virtio_scsi(self, value):
"""
Sets the value of the `virtio_scsi` property.
"""
Struct._check_type('virtio_scsi', value, VirtioScsi)
self._virtio_scsi = value
@property
def custom_cpu_model(self):
"""
Returns the value of the `custom_cpu_model` property.
"""
return self._custom_cpu_model
@custom_cpu_model.setter
def custom_cpu_model(self, value):
"""
Sets the value of the `custom_cpu_model` property.
"""
self._custom_cpu_model = value
@property
def soundcard_enabled(self):
"""
Returns the value of the `soundcard_enabled` property.
"""
return self._soundcard_enabled
@soundcard_enabled.setter
def soundcard_enabled(self, value):
"""
Sets the value of the `soundcard_enabled` property.
"""
self._soundcard_enabled = value
@property
def tunnel_migration(self):
"""
Returns the value of the `tunnel_migration` property.
"""
return self._tunnel_migration
@tunnel_migration.setter
def tunnel_migration(self, value):
"""
Sets the value of the `tunnel_migration` property.
"""
self._tunnel_migration = value
@property
def auto_pinning_policy(self):
"""
Returns the value of the `auto_pinning_policy` property.
"""
return self._auto_pinning_policy
@auto_pinning_policy.setter
def auto_pinning_policy(self, value):
"""
Sets the value of the `auto_pinning_policy` property.
"""
Struct._check_type('auto_pinning_policy', value, AutoPinningPolicy)
self._auto_pinning_policy = value
@property
def large_icon(self):
"""
Returns the value of the `large_icon` property.
"""
return self._large_icon
@large_icon.setter
def large_icon(self, value):
"""
Sets the value of the `large_icon` property.
"""
Struct._check_type('large_icon', value, Icon)
self._large_icon = value
@property
def lease(self):
"""
Returns the value of the `lease` property.
"""
return self._lease
@lease.setter
def lease(self, value):
"""
Sets the value of the `lease` property.
"""
Struct._check_type('lease', value, StorageDomainLease)
self._lease = value
@property
def virtio_scsi_multi_queues_enabled(self):
"""
Returns the value of the `virtio_scsi_multi_queues_enabled` property.
"""
return self._virtio_scsi_multi_queues_enabled
@virtio_scsi_multi_queues_enabled.setter
def virtio_scsi_multi_queues_enabled(self, value):
"""
Sets the value of the `virtio_scsi_multi_queues_enabled` property.
"""
self._virtio_scsi_multi_queues_enabled = value
@property
def migration(self):
"""
Returns the value of the `migration` property.
"""
return self._migration
@migration.setter
def migration(self, value):
"""
Sets the value of the `migration` property.
"""
Struct._check_type('migration', value, MigrationOptions)
self._migration = value
@property
def cpu_shares(self):
"""
Returns the value of the `cpu_shares` property.
"""
return self._cpu_shares
@cpu_shares.setter
def cpu_shares(self, value):
"""
Sets the value of the `cpu_shares` property.
"""
self._cpu_shares = value
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def memory(self):
"""
Returns the value of the `memory` property.
"""
return self._memory
@memory.setter
def memory(self, value):
"""
Sets the value of the `memory` property.
"""
self._memory = value
@property
def usb(self):
"""
Returns the value of the `usb` property.
"""
return self._usb
@usb.setter
def usb(self, value):
"""
Sets the value of the `usb` property.
"""
Struct._check_type('usb', value, Usb)
self._usb = value
@property
def custom_emulated_machine(self):
"""
Returns the value of the `custom_emulated_machine` property.
"""
return self._custom_emulated_machine
@custom_emulated_machine.setter
def custom_emulated_machine(self, value):
"""
Sets the value of the `custom_emulated_machine` property.
"""
self._custom_emulated_machine = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def bios(self):
"""
Returns the value of the `bios` property.
"""
return self._bios
@bios.setter
def bios(self, value):
"""
Sets the value of the `bios` property.
"""
Struct._check_type('bios', value, Bios)
self._bios = value
@property
def origin(self):
"""
Returns the value of the `origin` property.
"""
return self._origin
@origin.setter
def origin(self, value):
"""
Sets the value of the `origin` property.
"""
self._origin = value
@property
def multi_queues_enabled(self):
"""
Returns the value of the `multi_queues_enabled` property.
"""
return self._multi_queues_enabled
@multi_queues_enabled.setter
def multi_queues_enabled(self, value):
"""
Sets the value of the `multi_queues_enabled` property.
"""
self._multi_queues_enabled = value
@property
def custom_properties(self):
"""
Returns the value of the `custom_properties` property.
"""
return self._custom_properties
@custom_properties.setter
def custom_properties(self, value):
"""
Sets the value of the `custom_properties` property.
"""
self._custom_properties = value
@property
def rng_device(self):
"""
Returns the value of the `rng_device` property.
"""
return self._rng_device
@rng_device.setter
def rng_device(self, value):
"""
Sets the value of the `rng_device` property.
"""
Struct._check_type('rng_device', value, RngDevice)
self._rng_device = value
@property
def cpu_pinning_policy(self):
"""
Returns the value of the `cpu_pinning_policy` property.
"""
return self._cpu_pinning_policy
@cpu_pinning_policy.setter
def cpu_pinning_policy(self, value):
"""
Sets the value of the `cpu_pinning_policy` property.
"""
Struct._check_type('cpu_pinning_policy', value, CpuPinningPolicy)
self._cpu_pinning_policy = value
@property
def creation_time(self):
"""
Returns the value of the `creation_time` property.
"""
return self._creation_time
@creation_time.setter
def creation_time(self, value):
"""
Sets the value of the `creation_time` property.
"""
self._creation_time = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, VmType)
self._type = value
@property
def sso(self):
"""
Returns the value of the `sso` property.
"""
return self._sso
@sso.setter
def sso(self, value):
"""
Sets the value of the `sso` property.
"""
Struct._check_type('sso', value, Sso)
self._sso = value
@property
def virtio_scsi_multi_queues(self):
"""
Returns the value of the `virtio_scsi_multi_queues` property.
"""
return self._virtio_scsi_multi_queues
@virtio_scsi_multi_queues.setter
def virtio_scsi_multi_queues(self, value):
"""
Sets the value of the `virtio_scsi_multi_queues` property.
"""
self._virtio_scsi_multi_queues = value
@property
def tpm_enabled(self):
"""
Returns the value of the `tpm_enabled` property.
"""
return self._tpm_enabled
@tpm_enabled.setter
def tpm_enabled(self, value):
"""
Sets the value of the `tpm_enabled` property.
"""
self._tpm_enabled = value
@property
def start_paused(self):
"""
Returns the value of the `start_paused` property.
"""
return self._start_paused
@start_paused.setter
def start_paused(self, value):
"""
Sets the value of the `start_paused` property.
"""
self._start_paused = value
@property
def quota(self):
"""
Returns the value of the `quota` property.
"""
return self._quota
@quota.setter
def quota(self, value):
"""
Sets the value of the `quota` property.
"""
Struct._check_type('quota', value, Quota)
self._quota = value
@property
def custom_compatibility_version(self):
"""
Returns the value of the `custom_compatibility_version` property.
"""
return self._custom_compatibility_version
@custom_compatibility_version.setter
def custom_compatibility_version(self, value):
"""
Sets the value of the `custom_compatibility_version` property.
"""
Struct._check_type('custom_compatibility_version', value, Version)
self._custom_compatibility_version = value
@property
def stateless(self):
"""
Returns the value of the `stateless` property.
"""
return self._stateless
@stateless.setter
def stateless(self, value):
"""
Sets the value of the `stateless` property.
"""
self._stateless = value
@property
def storage_error_resume_behaviour(self):
"""
Returns the value of the `storage_error_resume_behaviour` property.
"""
return self._storage_error_resume_behaviour
@storage_error_resume_behaviour.setter
def storage_error_resume_behaviour(self, value):
"""
Sets the value of the `storage_error_resume_behaviour` property.
"""
Struct._check_type('storage_error_resume_behaviour', value, VmStorageErrorResumeBehaviour)
self._storage_error_resume_behaviour = value
@property
def placement_policy(self):
"""
Returns the value of the `placement_policy` property.
"""
return self._placement_policy
@placement_policy.setter
def placement_policy(self, value):
"""
Sets the value of the `placement_policy` property.
"""
Struct._check_type('placement_policy', value, VmPlacementPolicy)
self._placement_policy = value
@property
def cpu_profile(self):
"""
Returns the value of the `cpu_profile` property.
"""
return self._cpu_profile
@cpu_profile.setter
def cpu_profile(self, value):
"""
Sets the value of the `cpu_profile` property.
"""
Struct._check_type('cpu_profile', value, CpuProfile)
self._cpu_profile = value
class VmPlacementPolicy(Struct):
def __init__(
self,
affinity=None,
hosts=None,
):
super(VmPlacementPolicy, self).__init__(
)
self.affinity = affinity
self.hosts = hosts
@property
def affinity(self):
"""
Returns the value of the `affinity` property.
"""
return self._affinity
@affinity.setter
def affinity(self, value):
"""
Sets the value of the `affinity` property.
"""
Struct._check_type('affinity', value, VmAffinity)
self._affinity = value
@property
def hosts(self):
"""
Returns the value of the `hosts` property.
"""
return self._hosts
@hosts.setter
def hosts(self, value):
"""
Sets the value of the `hosts` property.
"""
self._hosts = value
class VmPool(Identified):
def __init__(
self,
auto_storage_select=None,
cluster=None,
comment=None,
description=None,
display=None,
id=None,
instance_type=None,
max_user_vms=None,
name=None,
permissions=None,
prestarted_vms=None,
rng_device=None,
size=None,
soundcard_enabled=None,
stateful=None,
template=None,
tpm_enabled=None,
type=None,
use_latest_template_version=None,
vm=None,
):
super(VmPool, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.auto_storage_select = auto_storage_select
self.cluster = cluster
self.display = display
self.instance_type = instance_type
self.max_user_vms = max_user_vms
self.permissions = permissions
self.prestarted_vms = prestarted_vms
self.rng_device = rng_device
self.size = size
self.soundcard_enabled = soundcard_enabled
self.stateful = stateful
self.template = template
self.tpm_enabled = tpm_enabled
self.type = type
self.use_latest_template_version = use_latest_template_version
self.vm = vm
@property
def use_latest_template_version(self):
"""
Returns the value of the `use_latest_template_version` property.
"""
return self._use_latest_template_version
@use_latest_template_version.setter
def use_latest_template_version(self, value):
"""
Sets the value of the `use_latest_template_version` property.
"""
self._use_latest_template_version = value
@property
def max_user_vms(self):
"""
Returns the value of the `max_user_vms` property.
"""
return self._max_user_vms
@max_user_vms.setter
def max_user_vms(self, value):
"""
Sets the value of the `max_user_vms` property.
"""
self._max_user_vms = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def display(self):
"""
Returns the value of the `display` property.
"""
return self._display
@display.setter
def display(self, value):
"""
Sets the value of the `display` property.
"""
Struct._check_type('display', value, Display)
self._display = value
@property
def auto_storage_select(self):
"""
Returns the value of the `auto_storage_select` property.
"""
return self._auto_storage_select
@auto_storage_select.setter
def auto_storage_select(self, value):
"""
Sets the value of the `auto_storage_select` property.
"""
self._auto_storage_select = value
@property
def rng_device(self):
"""
Returns the value of the `rng_device` property.
"""
return self._rng_device
@rng_device.setter
def rng_device(self, value):
"""
Sets the value of the `rng_device` property.
"""
Struct._check_type('rng_device', value, RngDevice)
self._rng_device = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, VmPoolType)
self._type = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def tpm_enabled(self):
"""
Returns the value of the `tpm_enabled` property.
"""
return self._tpm_enabled
@tpm_enabled.setter
def tpm_enabled(self, value):
"""
Sets the value of the `tpm_enabled` property.
"""
self._tpm_enabled = value
@property
def instance_type(self):
"""
Returns the value of the `instance_type` property.
"""
return self._instance_type
@instance_type.setter
def instance_type(self, value):
"""
Sets the value of the `instance_type` property.
"""
Struct._check_type('instance_type', value, InstanceType)
self._instance_type = value
@property
def size(self):
"""
Returns the value of the `size` property.
"""
return self._size
@size.setter
def size(self, value):
"""
Sets the value of the `size` property.
"""
self._size = value
@property
def soundcard_enabled(self):
"""
Returns the value of the `soundcard_enabled` property.
"""
return self._soundcard_enabled
@soundcard_enabled.setter
def soundcard_enabled(self, value):
"""
Sets the value of the `soundcard_enabled` property.
"""
self._soundcard_enabled = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def stateful(self):
"""
Returns the value of the `stateful` property.
"""
return self._stateful
@stateful.setter
def stateful(self, value):
"""
Sets the value of the `stateful` property.
"""
self._stateful = value
@property
def prestarted_vms(self):
"""
Returns the value of the `prestarted_vms` property.
"""
return self._prestarted_vms
@prestarted_vms.setter
def prestarted_vms(self, value):
"""
Sets the value of the `prestarted_vms` property.
"""
self._prestarted_vms = value
class VmSummary(Struct):
def __init__(
self,
active=None,
migrating=None,
total=None,
):
super(VmSummary, self).__init__(
)
self.active = active
self.migrating = migrating
self.total = total
@property
def migrating(self):
"""
Returns the value of the `migrating` property.
"""
return self._migrating
@migrating.setter
def migrating(self, value):
"""
Sets the value of the `migrating` property.
"""
self._migrating = value
@property
def total(self):
"""
Returns the value of the `total` property.
"""
return self._total
@total.setter
def total(self, value):
"""
Sets the value of the `total` property.
"""
self._total = value
@property
def active(self):
"""
Returns the value of the `active` property.
"""
return self._active
@active.setter
def active(self, value):
"""
Sets the value of the `active` property.
"""
self._active = value
class VnicPassThrough(Struct):
def __init__(
self,
mode=None,
):
super(VnicPassThrough, self).__init__(
)
self.mode = mode
@property
def mode(self):
"""
Returns the value of the `mode` property.
"""
return self._mode
@mode.setter
def mode(self, value):
"""
Sets the value of the `mode` property.
"""
Struct._check_type('mode', value, VnicPassThroughMode)
self._mode = value
class VnicProfile(Identified):
def __init__(
self,
comment=None,
custom_properties=None,
description=None,
failover=None,
id=None,
migratable=None,
name=None,
network=None,
network_filter=None,
pass_through=None,
permissions=None,
port_mirroring=None,
qos=None,
):
super(VnicProfile, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.custom_properties = custom_properties
self.failover = failover
self.migratable = migratable
self.network = network
self.network_filter = network_filter
self.pass_through = pass_through
self.permissions = permissions
self.port_mirroring = port_mirroring
self.qos = qos
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def qos(self):
"""
Returns the value of the `qos` property.
"""
return self._qos
@qos.setter
def qos(self, value):
"""
Sets the value of the `qos` property.
"""
Struct._check_type('qos', value, Qos)
self._qos = value
@property
def failover(self):
"""
Returns the value of the `failover` property.
"""
return self._failover
@failover.setter
def failover(self, value):
"""
Sets the value of the `failover` property.
"""
Struct._check_type('failover', value, VnicProfile)
self._failover = value
@property
def pass_through(self):
"""
Returns the value of the `pass_through` property.
"""
return self._pass_through
@pass_through.setter
def pass_through(self, value):
"""
Sets the value of the `pass_through` property.
"""
Struct._check_type('pass_through', value, VnicPassThrough)
self._pass_through = value
@property
def network_filter(self):
"""
Returns the value of the `network_filter` property.
"""
return self._network_filter
@network_filter.setter
def network_filter(self, value):
"""
Sets the value of the `network_filter` property.
"""
Struct._check_type('network_filter', value, NetworkFilter)
self._network_filter = value
@property
def custom_properties(self):
"""
Returns the value of the `custom_properties` property.
"""
return self._custom_properties
@custom_properties.setter
def custom_properties(self, value):
"""
Sets the value of the `custom_properties` property.
"""
self._custom_properties = value
@property
def network(self):
"""
Returns the value of the `network` property.
"""
return self._network
@network.setter
def network(self, value):
"""
Sets the value of the `network` property.
"""
Struct._check_type('network', value, Network)
self._network = value
@property
def port_mirroring(self):
"""
Returns the value of the `port_mirroring` property.
"""
return self._port_mirroring
@port_mirroring.setter
def port_mirroring(self, value):
"""
Sets the value of the `port_mirroring` property.
"""
self._port_mirroring = value
@property
def migratable(self):
"""
Returns the value of the `migratable` property.
"""
return self._migratable
@migratable.setter
def migratable(self, value):
"""
Sets the value of the `migratable` property.
"""
self._migratable = value
class VnicProfileMapping(Struct):
def __init__(
self,
source_network_name=None,
source_network_profile_name=None,
target_vnic_profile=None,
):
super(VnicProfileMapping, self).__init__(
)
self.source_network_name = source_network_name
self.source_network_profile_name = source_network_profile_name
self.target_vnic_profile = target_vnic_profile
@property
def source_network_name(self):
"""
Returns the value of the `source_network_name` property.
"""
return self._source_network_name
@source_network_name.setter
def source_network_name(self, value):
"""
Sets the value of the `source_network_name` property.
"""
self._source_network_name = value
@property
def source_network_profile_name(self):
"""
Returns the value of the `source_network_profile_name` property.
"""
return self._source_network_profile_name
@source_network_profile_name.setter
def source_network_profile_name(self, value):
"""
Sets the value of the `source_network_profile_name` property.
"""
self._source_network_profile_name = value
@property
def target_vnic_profile(self):
"""
Returns the value of the `target_vnic_profile` property.
"""
return self._target_vnic_profile
@target_vnic_profile.setter
def target_vnic_profile(self, value):
"""
Sets the value of the `target_vnic_profile` property.
"""
Struct._check_type('target_vnic_profile', value, VnicProfile)
self._target_vnic_profile = value
class VolumeGroup(Struct):
def __init__(
self,
id=None,
logical_units=None,
name=None,
):
super(VolumeGroup, self).__init__(
)
self.id = id
self.logical_units = logical_units
self.name = name
@property
def logical_units(self):
"""
Returns the value of the `logical_units` property.
"""
return self._logical_units
@logical_units.setter
def logical_units(self, value):
"""
Sets the value of the `logical_units` property.
"""
self._logical_units = value
@property
def name(self):
"""
Returns the value of the `name` property.
"""
return self._name
@name.setter
def name(self, value):
"""
Sets the value of the `name` property.
"""
self._name = value
@property
def id(self):
"""
Returns the value of the `id` property.
"""
return self._id
@id.setter
def id(self, value):
"""
Sets the value of the `id` property.
"""
self._id = value
class Weight(Identified):
def __init__(
self,
comment=None,
description=None,
factor=None,
id=None,
name=None,
scheduling_policy=None,
scheduling_policy_unit=None,
):
super(Weight, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.factor = factor
self.scheduling_policy = scheduling_policy
self.scheduling_policy_unit = scheduling_policy_unit
@property
def scheduling_policy(self):
"""
Returns the value of the `scheduling_policy` property.
"""
return self._scheduling_policy
@scheduling_policy.setter
def scheduling_policy(self, value):
"""
Sets the value of the `scheduling_policy` property.
"""
Struct._check_type('scheduling_policy', value, SchedulingPolicy)
self._scheduling_policy = value
@property
def scheduling_policy_unit(self):
"""
Returns the value of the `scheduling_policy_unit` property.
"""
return self._scheduling_policy_unit
@scheduling_policy_unit.setter
def scheduling_policy_unit(self, value):
"""
Sets the value of the `scheduling_policy_unit` property.
"""
Struct._check_type('scheduling_policy_unit', value, SchedulingPolicyUnit)
self._scheduling_policy_unit = value
@property
def factor(self):
"""
Returns the value of the `factor` property.
"""
return self._factor
@factor.setter
def factor(self, value):
"""
Sets the value of the `factor` property.
"""
self._factor = value
class Action(Identified):
def __init__(
self,
activate=None,
allow_partial_import=None,
async_=None,
attachment=None,
authorized_key=None,
auto_pinning_policy=None,
bricks=None,
certificates=None,
check_connectivity=None,
clone=None,
clone_permissions=None,
cluster=None,
collapse_snapshots=None,
comment=None,
commit_on_success=None,
connection=None,
connectivity_timeout=None,
correlation_id=None,
data_center=None,
deploy_hosted_engine=None,
description=None,
details=None,
directory=None,
discard_snapshots=None,
discovered_targets=None,
disk=None,
disk_profile=None,
disks=None,
exclusive=None,
fault=None,
fence_type=None,
filename=None,
filter=None,
fix_layout=None,
follow=None,
force=None,
grace_period=None,
host=None,
id=None,
image=None,
image_transfer=None,
import_as_template=None,
is_attached=None,
iscsi=None,
iscsi_targets=None,
job=None,
lease=None,
logical_units=None,
maintenance_after_restart=None,
maintenance_enabled=None,
migrate_vms_in_affinity_closure=None,
modified_bonds=None,
modified_labels=None,
modified_network_attachments=None,
name=None,
optimize_cpu_settings=None,
option=None,
pause=None,
permission=None,
power_management=None,
proxy_ticket=None,
quota=None,
reason=None,
reassign_bad_macs=None,
reboot=None,
registration_configuration=None,
remote_viewer_connection_file=None,
removed_bonds=None,
removed_labels=None,
removed_network_attachments=None,
resolution_type=None,
restore_memory=None,
root_password=None,
seal=None,
snapshot=None,
source_host=None,
ssh=None,
status=None,
stop_gluster_service=None,
storage_domain=None,
storage_domains=None,
succeeded=None,
synchronized_network_attachments=None,
template=None,
ticket=None,
timeout=None,
undeploy_hosted_engine=None,
upgrade_action=None,
upgrade_percent_complete=None,
use_cloud_init=None,
use_ignition=None,
use_initialization=None,
use_sysprep=None,
virtual_functions_configuration=None,
vm=None,
vnic_profile_mappings=None,
volatile=None,
):
super(Action, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.activate = activate
self.allow_partial_import = allow_partial_import
self.async_ = async_
self.attachment = attachment
self.authorized_key = authorized_key
self.auto_pinning_policy = auto_pinning_policy
self.bricks = bricks
self.certificates = certificates
self.check_connectivity = check_connectivity
self.clone = clone
self.clone_permissions = clone_permissions
self.cluster = cluster
self.collapse_snapshots = collapse_snapshots
self.commit_on_success = commit_on_success
self.connection = connection
self.connectivity_timeout = connectivity_timeout
self.correlation_id = correlation_id
self.data_center = data_center
self.deploy_hosted_engine = deploy_hosted_engine
self.details = details
self.directory = directory
self.discard_snapshots = discard_snapshots
self.discovered_targets = discovered_targets
self.disk = disk
self.disk_profile = disk_profile
self.disks = disks
self.exclusive = exclusive
self.fault = fault
self.fence_type = fence_type
self.filename = filename
self.filter = filter
self.fix_layout = fix_layout
self.follow = follow
self.force = force
self.grace_period = grace_period
self.host = host
self.image = image
self.image_transfer = image_transfer
self.import_as_template = import_as_template
self.is_attached = is_attached
self.iscsi = iscsi
self.iscsi_targets = iscsi_targets
self.job = job
self.lease = lease
self.logical_units = logical_units
self.maintenance_after_restart = maintenance_after_restart
self.maintenance_enabled = maintenance_enabled
self.migrate_vms_in_affinity_closure = migrate_vms_in_affinity_closure
self.modified_bonds = modified_bonds
self.modified_labels = modified_labels
self.modified_network_attachments = modified_network_attachments
self.optimize_cpu_settings = optimize_cpu_settings
self.option = option
self.pause = pause
self.permission = permission
self.power_management = power_management
self.proxy_ticket = proxy_ticket
self.quota = quota
self.reason = reason
self.reassign_bad_macs = reassign_bad_macs
self.reboot = reboot
self.registration_configuration = registration_configuration
self.remote_viewer_connection_file = remote_viewer_connection_file
self.removed_bonds = removed_bonds
self.removed_labels = removed_labels
self.removed_network_attachments = removed_network_attachments
self.resolution_type = resolution_type
self.restore_memory = restore_memory
self.root_password = root_password
self.seal = seal
self.snapshot = snapshot
self.source_host = source_host
self.ssh = ssh
self.status = status
self.stop_gluster_service = stop_gluster_service
self.storage_domain = storage_domain
self.storage_domains = storage_domains
self.succeeded = succeeded
self.synchronized_network_attachments = synchronized_network_attachments
self.template = template
self.ticket = ticket
self.timeout = timeout
self.undeploy_hosted_engine = undeploy_hosted_engine
self.upgrade_action = upgrade_action
self.upgrade_percent_complete = upgrade_percent_complete
self.use_cloud_init = use_cloud_init
self.use_ignition = use_ignition
self.use_initialization = use_initialization
self.use_sysprep = use_sysprep
self.virtual_functions_configuration = virtual_functions_configuration
self.vm = vm
self.vnic_profile_mappings = vnic_profile_mappings
self.volatile = volatile
@property
def image(self):
"""
Returns the value of the `image` property.
"""
return self._image
@image.setter
def image(self, value):
"""
Sets the value of the `image` property.
"""
self._image = value
@property
def reboot(self):
"""
Returns the value of the `reboot` property.
"""
return self._reboot
@reboot.setter
def reboot(self, value):
"""
Sets the value of the `reboot` property.
"""
self._reboot = value
@property
def image_transfer(self):
"""
Returns the value of the `image_transfer` property.
"""
return self._image_transfer
@image_transfer.setter
def image_transfer(self, value):
"""
Sets the value of the `image_transfer` property.
"""
Struct._check_type('image_transfer', value, ImageTransfer)
self._image_transfer = value
@property
def source_host(self):
"""
Returns the value of the `source_host` property.
"""
return self._source_host
@source_host.setter
def source_host(self, value):
"""
Sets the value of the `source_host` property.
"""
Struct._check_type('source_host', value, Host)
self._source_host = value
@property
def correlation_id(self):
"""
Returns the value of the `correlation_id` property.
"""
return self._correlation_id
@correlation_id.setter
def correlation_id(self, value):
"""
Sets the value of the `correlation_id` property.
"""
self._correlation_id = value
@property
def optimize_cpu_settings(self):
"""
Returns the value of the `optimize_cpu_settings` property.
"""
return self._optimize_cpu_settings
@optimize_cpu_settings.setter
def optimize_cpu_settings(self, value):
"""
Sets the value of the `optimize_cpu_settings` property.
"""
self._optimize_cpu_settings = value
@property
def fault(self):
"""
Returns the value of the `fault` property.
"""
return self._fault
@fault.setter
def fault(self, value):
"""
Sets the value of the `fault` property.
"""
Struct._check_type('fault', value, Fault)
self._fault = value
@property
def use_initialization(self):
"""
Returns the value of the `use_initialization` property.
"""
return self._use_initialization
@use_initialization.setter
def use_initialization(self, value):
"""
Sets the value of the `use_initialization` property.
"""
self._use_initialization = value
@property
def commit_on_success(self):
"""
Returns the value of the `commit_on_success` property.
"""
return self._commit_on_success
@commit_on_success.setter
def commit_on_success(self, value):
"""
Sets the value of the `commit_on_success` property.
"""
self._commit_on_success = value
@property
def resolution_type(self):
"""
Returns the value of the `resolution_type` property.
"""
return self._resolution_type
@resolution_type.setter
def resolution_type(self, value):
"""
Sets the value of the `resolution_type` property.
"""
self._resolution_type = value
@property
def storage_domains(self):
"""
Returns the value of the `storage_domains` property.
"""
return self._storage_domains
@storage_domains.setter
def storage_domains(self, value):
"""
Sets the value of the `storage_domains` property.
"""
self._storage_domains = value
@property
def check_connectivity(self):
"""
Returns the value of the `check_connectivity` property.
"""
return self._check_connectivity
@check_connectivity.setter
def check_connectivity(self, value):
"""
Sets the value of the `check_connectivity` property.
"""
self._check_connectivity = value
@property
def follow(self):
"""
Returns the value of the `follow` property.
"""
return self._follow
@follow.setter
def follow(self, value):
"""
Sets the value of the `follow` property.
"""
self._follow = value
@property
def collapse_snapshots(self):
"""
Returns the value of the `collapse_snapshots` property.
"""
return self._collapse_snapshots
@collapse_snapshots.setter
def collapse_snapshots(self, value):
"""
Sets the value of the `collapse_snapshots` property.
"""
self._collapse_snapshots = value
@property
def filename(self):
"""
Returns the value of the `filename` property.
"""
return self._filename
@filename.setter
def filename(self, value):
"""
Sets the value of the `filename` property.
"""
self._filename = value
@property
def disk(self):
"""
Returns the value of the `disk` property.
"""
return self._disk
@disk.setter
def disk(self, value):
"""
Sets the value of the `disk` property.
"""
Struct._check_type('disk', value, Disk)
self._disk = value
@property
def async_(self):
"""
Returns the value of the `async_` property.
"""
return self._async_
@async_.setter
def async_(self, value):
"""
Sets the value of the `async_` property.
"""
self._async_ = value
@property
def virtual_functions_configuration(self):
"""
Returns the value of the `virtual_functions_configuration` property.
"""
return self._virtual_functions_configuration
@virtual_functions_configuration.setter
def virtual_functions_configuration(self, value):
"""
Sets the value of the `virtual_functions_configuration` property.
"""
Struct._check_type('virtual_functions_configuration', value, HostNicVirtualFunctionsConfiguration)
self._virtual_functions_configuration = value
@property
def modified_labels(self):
"""
Returns the value of the `modified_labels` property.
"""
return self._modified_labels
@modified_labels.setter
def modified_labels(self, value):
"""
Sets the value of the `modified_labels` property.
"""
self._modified_labels = value
@property
def snapshot(self):
"""
Returns the value of the `snapshot` property.
"""
return self._snapshot
@snapshot.setter
def snapshot(self, value):
"""
Sets the value of the `snapshot` property.
"""
Struct._check_type('snapshot', value, Snapshot)
self._snapshot = value
@property
def proxy_ticket(self):
"""
Returns the value of the `proxy_ticket` property.
"""
return self._proxy_ticket
@proxy_ticket.setter
def proxy_ticket(self, value):
"""
Sets the value of the `proxy_ticket` property.
"""
Struct._check_type('proxy_ticket', value, ProxyTicket)
self._proxy_ticket = value
@property
def filter(self):
"""
Returns the value of the `filter` property.
"""
return self._filter
@filter.setter
def filter(self, value):
"""
Sets the value of the `filter` property.
"""
self._filter = value
@property
def clone_permissions(self):
"""
Returns the value of the `clone_permissions` property.
"""
return self._clone_permissions
@clone_permissions.setter
def clone_permissions(self, value):
"""
Sets the value of the `clone_permissions` property.
"""
self._clone_permissions = value
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def maintenance_after_restart(self):
"""
Returns the value of the `maintenance_after_restart` property.
"""
return self._maintenance_after_restart
@maintenance_after_restart.setter
def maintenance_after_restart(self, value):
"""
Sets the value of the `maintenance_after_restart` property.
"""
self._maintenance_after_restart = value
@property
def reason(self):
"""
Returns the value of the `reason` property.
"""
return self._reason
@reason.setter
def reason(self, value):
"""
Sets the value of the `reason` property.
"""
self._reason = value
@property
def ssh(self):
"""
Returns the value of the `ssh` property.
"""
return self._ssh
@ssh.setter
def ssh(self, value):
"""
Sets the value of the `ssh` property.
"""
Struct._check_type('ssh', value, Ssh)
self._ssh = value
@property
def disks(self):
"""
Returns the value of the `disks` property.
"""
return self._disks
@disks.setter
def disks(self, value):
"""
Sets the value of the `disks` property.
"""
self._disks = value
@property
def seal(self):
"""
Returns the value of the `seal` property.
"""
return self._seal
@seal.setter
def seal(self, value):
"""
Sets the value of the `seal` property.
"""
self._seal = value
@property
def directory(self):
"""
Returns the value of the `directory` property.
"""
return self._directory
@directory.setter
def directory(self, value):
"""
Sets the value of the `directory` property.
"""
self._directory = value
@property
def disk_profile(self):
"""
Returns the value of the `disk_profile` property.
"""
return self._disk_profile
@disk_profile.setter
def disk_profile(self, value):
"""
Sets the value of the `disk_profile` property.
"""
Struct._check_type('disk_profile', value, DiskProfile)
self._disk_profile = value
@property
def removed_network_attachments(self):
"""
Returns the value of the `removed_network_attachments` property.
"""
return self._removed_network_attachments
@removed_network_attachments.setter
def removed_network_attachments(self, value):
"""
Sets the value of the `removed_network_attachments` property.
"""
self._removed_network_attachments = value
@property
def timeout(self):
"""
Returns the value of the `timeout` property.
"""
return self._timeout
@timeout.setter
def timeout(self, value):
"""
Sets the value of the `timeout` property.
"""
self._timeout = value
@property
def maintenance_enabled(self):
"""
Returns the value of the `maintenance_enabled` property.
"""
return self._maintenance_enabled
@maintenance_enabled.setter
def maintenance_enabled(self, value):
"""
Sets the value of the `maintenance_enabled` property.
"""
self._maintenance_enabled = value
@property
def connectivity_timeout(self):
"""
Returns the value of the `connectivity_timeout` property.
"""
return self._connectivity_timeout
@connectivity_timeout.setter
def connectivity_timeout(self, value):
"""
Sets the value of the `connectivity_timeout` property.
"""
self._connectivity_timeout = value
@property
def modified_network_attachments(self):
"""
Returns the value of the `modified_network_attachments` property.
"""
return self._modified_network_attachments
@modified_network_attachments.setter
def modified_network_attachments(self, value):
"""
Sets the value of the `modified_network_attachments` property.
"""
self._modified_network_attachments = value
@property
def registration_configuration(self):
"""
Returns the value of the `registration_configuration` property.
"""
return self._registration_configuration
@registration_configuration.setter
def registration_configuration(self, value):
"""
Sets the value of the `registration_configuration` property.
"""
Struct._check_type('registration_configuration', value, RegistrationConfiguration)
self._registration_configuration = value
@property
def discard_snapshots(self):
"""
Returns the value of the `discard_snapshots` property.
"""
return self._discard_snapshots
@discard_snapshots.setter
def discard_snapshots(self, value):
"""
Sets the value of the `discard_snapshots` property.
"""
self._discard_snapshots = value
@property
def synchronized_network_attachments(self):
"""
Returns the value of the `synchronized_network_attachments` property.
"""
return self._synchronized_network_attachments
@synchronized_network_attachments.setter
def synchronized_network_attachments(self, value):
"""
Sets the value of the `synchronized_network_attachments` property.
"""
self._synchronized_network_attachments = value
@property
def use_sysprep(self):
"""
Returns the value of the `use_sysprep` property.
"""
return self._use_sysprep
@use_sysprep.setter
def use_sysprep(self, value):
"""
Sets the value of the `use_sysprep` property.
"""
self._use_sysprep = value
@property
def attachment(self):
"""
Returns the value of the `attachment` property.
"""
return self._attachment
@attachment.setter
def attachment(self, value):
"""
Sets the value of the `attachment` property.
"""
Struct._check_type('attachment', value, DiskAttachment)
self._attachment = value
@property
def power_management(self):
"""
Returns the value of the `power_management` property.
"""
return self._power_management
@power_management.setter
def power_management(self, value):
"""
Sets the value of the `power_management` property.
"""
Struct._check_type('power_management', value, PowerManagement)
self._power_management = value
@property
def connection(self):
"""
Returns the value of the `connection` property.
"""
return self._connection
@connection.setter
def connection(self, value):
"""
Sets the value of the `connection` property.
"""
Struct._check_type('connection', value, StorageConnection)
self._connection = value
@property
def details(self):
"""
Returns the value of the `details` property.
"""
return self._details
@details.setter
def details(self, value):
"""
Sets the value of the `details` property.
"""
Struct._check_type('details', value, GlusterVolumeProfileDetails)
self._details = value
@property
def exclusive(self):
"""
Returns the value of the `exclusive` property.
"""
return self._exclusive
@exclusive.setter
def exclusive(self, value):
"""
Sets the value of the `exclusive` property.
"""
self._exclusive = value
@property
def root_password(self):
"""
Returns the value of the `root_password` property.
"""
return self._root_password
@root_password.setter
def root_password(self, value):
"""
Sets the value of the `root_password` property.
"""
self._root_password = value
@property
def allow_partial_import(self):
"""
Returns the value of the `allow_partial_import` property.
"""
return self._allow_partial_import
@allow_partial_import.setter
def allow_partial_import(self, value):
"""
Sets the value of the `allow_partial_import` property.
"""
self._allow_partial_import = value
@property
def remote_viewer_connection_file(self):
"""
Returns the value of the `remote_viewer_connection_file` property.
"""
return self._remote_viewer_connection_file
@remote_viewer_connection_file.setter
def remote_viewer_connection_file(self, value):
"""
Sets the value of the `remote_viewer_connection_file` property.
"""
self._remote_viewer_connection_file = value
@property
def bricks(self):
"""
Returns the value of the `bricks` property.
"""
return self._bricks
@bricks.setter
def bricks(self, value):
"""
Sets the value of the `bricks` property.
"""
self._bricks = value
@property
def import_as_template(self):
"""
Returns the value of the `import_as_template` property.
"""
return self._import_as_template
@import_as_template.setter
def import_as_template(self, value):
"""
Sets the value of the `import_as_template` property.
"""
self._import_as_template = value
@property
def ticket(self):
"""
Returns the value of the `ticket` property.
"""
return self._ticket
@ticket.setter
def ticket(self, value):
"""
Sets the value of the `ticket` property.
"""
Struct._check_type('ticket', value, Ticket)
self._ticket = value
@property
def deploy_hosted_engine(self):
"""
Returns the value of the `deploy_hosted_engine` property.
"""
return self._deploy_hosted_engine
@deploy_hosted_engine.setter
def deploy_hosted_engine(self, value):
"""
Sets the value of the `deploy_hosted_engine` property.
"""
self._deploy_hosted_engine = value
@property
def restore_memory(self):
"""
Returns the value of the `restore_memory` property.
"""
return self._restore_memory
@restore_memory.setter
def restore_memory(self, value):
"""
Sets the value of the `restore_memory` property.
"""
self._restore_memory = value
@property
def permission(self):
"""
Returns the value of the `permission` property.
"""
return self._permission
@permission.setter
def permission(self, value):
"""
Sets the value of the `permission` property.
"""
Struct._check_type('permission', value, Permission)
self._permission = value
@property
def upgrade_percent_complete(self):
"""
Returns the value of the `upgrade_percent_complete` property.
"""
return self._upgrade_percent_complete
@upgrade_percent_complete.setter
def upgrade_percent_complete(self, value):
"""
Sets the value of the `upgrade_percent_complete` property.
"""
self._upgrade_percent_complete = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def pause(self):
"""
Returns the value of the `pause` property.
"""
return self._pause
@pause.setter
def pause(self, value):
"""
Sets the value of the `pause` property.
"""
self._pause = value
@property
def volatile(self):
"""
Returns the value of the `volatile` property.
"""
return self._volatile
@volatile.setter
def volatile(self, value):
"""
Sets the value of the `volatile` property.
"""
self._volatile = value
@property
def use_cloud_init(self):
"""
Returns the value of the `use_cloud_init` property.
"""
return self._use_cloud_init
@use_cloud_init.setter
def use_cloud_init(self, value):
"""
Sets the value of the `use_cloud_init` property.
"""
self._use_cloud_init = value
@property
def grace_period(self):
"""
Returns the value of the `grace_period` property.
"""
return self._grace_period
@grace_period.setter
def grace_period(self, value):
"""
Sets the value of the `grace_period` property.
"""
Struct._check_type('grace_period', value, GracePeriod)
self._grace_period = value
@property
def migrate_vms_in_affinity_closure(self):
"""
Returns the value of the `migrate_vms_in_affinity_closure` property.
"""
return self._migrate_vms_in_affinity_closure
@migrate_vms_in_affinity_closure.setter
def migrate_vms_in_affinity_closure(self, value):
"""
Sets the value of the `migrate_vms_in_affinity_closure` property.
"""
self._migrate_vms_in_affinity_closure = value
@property
def upgrade_action(self):
"""
Returns the value of the `upgrade_action` property.
"""
return self._upgrade_action
@upgrade_action.setter
def upgrade_action(self, value):
"""
Sets the value of the `upgrade_action` property.
"""
Struct._check_type('upgrade_action', value, ClusterUpgradeAction)
self._upgrade_action = value
@property
def certificates(self):
"""
Returns the value of the `certificates` property.
"""
return self._certificates
@certificates.setter
def certificates(self, value):
"""
Sets the value of the `certificates` property.
"""
self._certificates = value
@property
def iscsi(self):
"""
Returns the value of the `iscsi` property.
"""
return self._iscsi
@iscsi.setter
def iscsi(self, value):
"""
Sets the value of the `iscsi` property.
"""
Struct._check_type('iscsi', value, IscsiDetails)
self._iscsi = value
@property
def auto_pinning_policy(self):
"""
Returns the value of the `auto_pinning_policy` property.
"""
return self._auto_pinning_policy
@auto_pinning_policy.setter
def auto_pinning_policy(self, value):
"""
Sets the value of the `auto_pinning_policy` property.
"""
Struct._check_type('auto_pinning_policy', value, AutoPinningPolicy)
self._auto_pinning_policy = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def lease(self):
"""
Returns the value of the `lease` property.
"""
return self._lease
@lease.setter
def lease(self, value):
"""
Sets the value of the `lease` property.
"""
Struct._check_type('lease', value, StorageDomainLease)
self._lease = value
@property
def activate(self):
"""
Returns the value of the `activate` property.
"""
return self._activate
@activate.setter
def activate(self, value):
"""
Sets the value of the `activate` property.
"""
self._activate = value
@property
def clone(self):
"""
Returns the value of the `clone` property.
"""
return self._clone
@clone.setter
def clone(self, value):
"""
Sets the value of the `clone` property.
"""
self._clone = value
@property
def force(self):
"""
Returns the value of the `force` property.
"""
return self._force
@force.setter
def force(self, value):
"""
Sets the value of the `force` property.
"""
self._force = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
self._status = value
@property
def stop_gluster_service(self):
"""
Returns the value of the `stop_gluster_service` property.
"""
return self._stop_gluster_service
@stop_gluster_service.setter
def stop_gluster_service(self, value):
"""
Sets the value of the `stop_gluster_service` property.
"""
self._stop_gluster_service = value
@property
def job(self):
"""
Returns the value of the `job` property.
"""
return self._job
@job.setter
def job(self, value):
"""
Sets the value of the `job` property.
"""
Struct._check_type('job', value, Job)
self._job = value
@property
def option(self):
"""
Returns the value of the `option` property.
"""
return self._option
@option.setter
def option(self, value):
"""
Sets the value of the `option` property.
"""
Struct._check_type('option', value, Option)
self._option = value
@property
def succeeded(self):
"""
Returns the value of the `succeeded` property.
"""
return self._succeeded
@succeeded.setter
def succeeded(self, value):
"""
Sets the value of the `succeeded` property.
"""
self._succeeded = value
@property
def removed_labels(self):
"""
Returns the value of the `removed_labels` property.
"""
return self._removed_labels
@removed_labels.setter
def removed_labels(self, value):
"""
Sets the value of the `removed_labels` property.
"""
self._removed_labels = value
@property
def use_ignition(self):
"""
Returns the value of the `use_ignition` property.
"""
return self._use_ignition
@use_ignition.setter
def use_ignition(self, value):
"""
Sets the value of the `use_ignition` property.
"""
self._use_ignition = value
@property
def modified_bonds(self):
"""
Returns the value of the `modified_bonds` property.
"""
return self._modified_bonds
@modified_bonds.setter
def modified_bonds(self, value):
"""
Sets the value of the `modified_bonds` property.
"""
self._modified_bonds = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def is_attached(self):
"""
Returns the value of the `is_attached` property.
"""
return self._is_attached
@is_attached.setter
def is_attached(self, value):
"""
Sets the value of the `is_attached` property.
"""
self._is_attached = value
@property
def undeploy_hosted_engine(self):
"""
Returns the value of the `undeploy_hosted_engine` property.
"""
return self._undeploy_hosted_engine
@undeploy_hosted_engine.setter
def undeploy_hosted_engine(self, value):
"""
Sets the value of the `undeploy_hosted_engine` property.
"""
self._undeploy_hosted_engine = value
@property
def reassign_bad_macs(self):
"""
Returns the value of the `reassign_bad_macs` property.
"""
return self._reassign_bad_macs
@reassign_bad_macs.setter
def reassign_bad_macs(self, value):
"""
Sets the value of the `reassign_bad_macs` property.
"""
self._reassign_bad_macs = value
@property
def iscsi_targets(self):
"""
Returns the value of the `iscsi_targets` property.
"""
return self._iscsi_targets
@iscsi_targets.setter
def iscsi_targets(self, value):
"""
Sets the value of the `iscsi_targets` property.
"""
self._iscsi_targets = value
@property
def fence_type(self):
"""
Returns the value of the `fence_type` property.
"""
return self._fence_type
@fence_type.setter
def fence_type(self, value):
"""
Sets the value of the `fence_type` property.
"""
self._fence_type = value
@property
def discovered_targets(self):
"""
Returns the value of the `discovered_targets` property.
"""
return self._discovered_targets
@discovered_targets.setter
def discovered_targets(self, value):
"""
Sets the value of the `discovered_targets` property.
"""
self._discovered_targets = value
@property
def authorized_key(self):
"""
Returns the value of the `authorized_key` property.
"""
return self._authorized_key
@authorized_key.setter
def authorized_key(self, value):
"""
Sets the value of the `authorized_key` property.
"""
Struct._check_type('authorized_key', value, AuthorizedKey)
self._authorized_key = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def logical_units(self):
"""
Returns the value of the `logical_units` property.
"""
return self._logical_units
@logical_units.setter
def logical_units(self, value):
"""
Sets the value of the `logical_units` property.
"""
self._logical_units = value
@property
def quota(self):
"""
Returns the value of the `quota` property.
"""
return self._quota
@quota.setter
def quota(self, value):
"""
Sets the value of the `quota` property.
"""
Struct._check_type('quota', value, Quota)
self._quota = value
@property
def vnic_profile_mappings(self):
"""
Returns the value of the `vnic_profile_mappings` property.
"""
return self._vnic_profile_mappings
@vnic_profile_mappings.setter
def vnic_profile_mappings(self, value):
"""
Sets the value of the `vnic_profile_mappings` property.
"""
self._vnic_profile_mappings = value
@property
def removed_bonds(self):
"""
Returns the value of the `removed_bonds` property.
"""
return self._removed_bonds
@removed_bonds.setter
def removed_bonds(self, value):
"""
Sets the value of the `removed_bonds` property.
"""
self._removed_bonds = value
@property
def fix_layout(self):
"""
Returns the value of the `fix_layout` property.
"""
return self._fix_layout
@fix_layout.setter
def fix_layout(self, value):
"""
Sets the value of the `fix_layout` property.
"""
self._fix_layout = value
class AffinityGroup(Identified):
def __init__(
self,
broken=None,
cluster=None,
comment=None,
description=None,
enforcing=None,
host_labels=None,
hosts=None,
hosts_rule=None,
id=None,
name=None,
positive=None,
priority=None,
vm_labels=None,
vms=None,
vms_rule=None,
):
super(AffinityGroup, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.broken = broken
self.cluster = cluster
self.enforcing = enforcing
self.host_labels = host_labels
self.hosts = hosts
self.hosts_rule = hosts_rule
self.positive = positive
self.priority = priority
self.vm_labels = vm_labels
self.vms = vms
self.vms_rule = vms_rule
@property
def broken(self):
"""
Returns the value of the `broken` property.
"""
return self._broken
@broken.setter
def broken(self, value):
"""
Sets the value of the `broken` property.
"""
self._broken = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def enforcing(self):
"""
Returns the value of the `enforcing` property.
"""
return self._enforcing
@enforcing.setter
def enforcing(self, value):
"""
Sets the value of the `enforcing` property.
"""
self._enforcing = value
@property
def host_labels(self):
"""
Returns the value of the `host_labels` property.
"""
return self._host_labels
@host_labels.setter
def host_labels(self, value):
"""
Sets the value of the `host_labels` property.
"""
self._host_labels = value
@property
def hosts(self):
"""
Returns the value of the `hosts` property.
"""
return self._hosts
@hosts.setter
def hosts(self, value):
"""
Sets the value of the `hosts` property.
"""
self._hosts = value
@property
def positive(self):
"""
Returns the value of the `positive` property.
"""
return self._positive
@positive.setter
def positive(self, value):
"""
Sets the value of the `positive` property.
"""
self._positive = value
@property
def vms(self):
"""
Returns the value of the `vms` property.
"""
return self._vms
@vms.setter
def vms(self, value):
"""
Sets the value of the `vms` property.
"""
self._vms = value
@property
def priority(self):
"""
Returns the value of the `priority` property.
"""
return self._priority
@priority.setter
def priority(self, value):
"""
Sets the value of the `priority` property.
"""
self._priority = value
@property
def vm_labels(self):
"""
Returns the value of the `vm_labels` property.
"""
return self._vm_labels
@vm_labels.setter
def vm_labels(self, value):
"""
Sets the value of the `vm_labels` property.
"""
self._vm_labels = value
@property
def vms_rule(self):
"""
Returns the value of the `vms_rule` property.
"""
return self._vms_rule
@vms_rule.setter
def vms_rule(self, value):
"""
Sets the value of the `vms_rule` property.
"""
Struct._check_type('vms_rule', value, AffinityRule)
self._vms_rule = value
@property
def hosts_rule(self):
"""
Returns the value of the `hosts_rule` property.
"""
return self._hosts_rule
@hosts_rule.setter
def hosts_rule(self, value):
"""
Sets the value of the `hosts_rule` property.
"""
Struct._check_type('hosts_rule', value, AffinityRule)
self._hosts_rule = value
class AffinityLabel(Identified):
def __init__(
self,
comment=None,
description=None,
has_implicit_affinity_group=None,
hosts=None,
id=None,
name=None,
read_only=None,
vms=None,
):
super(AffinityLabel, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.has_implicit_affinity_group = has_implicit_affinity_group
self.hosts = hosts
self.read_only = read_only
self.vms = vms
@property
def hosts(self):
"""
Returns the value of the `hosts` property.
"""
return self._hosts
@hosts.setter
def hosts(self, value):
"""
Sets the value of the `hosts` property.
"""
self._hosts = value
@property
def vms(self):
"""
Returns the value of the `vms` property.
"""
return self._vms
@vms.setter
def vms(self, value):
"""
Sets the value of the `vms` property.
"""
self._vms = value
@property
def has_implicit_affinity_group(self):
"""
Returns the value of the `has_implicit_affinity_group` property.
"""
return self._has_implicit_affinity_group
@has_implicit_affinity_group.setter
def has_implicit_affinity_group(self, value):
"""
Sets the value of the `has_implicit_affinity_group` property.
"""
self._has_implicit_affinity_group = value
@property
def read_only(self):
"""
Returns the value of the `read_only` property.
"""
return self._read_only
@read_only.setter
def read_only(self, value):
"""
Sets the value of the `read_only` property.
"""
self._read_only = value
class Agent(Identified):
def __init__(
self,
address=None,
comment=None,
concurrent=None,
description=None,
encrypt_options=None,
host=None,
id=None,
name=None,
options=None,
order=None,
password=None,
port=None,
type=None,
username=None,
):
super(Agent, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.address = address
self.concurrent = concurrent
self.encrypt_options = encrypt_options
self.host = host
self.options = options
self.order = order
self.password = password
self.port = port
self.type = type
self.username = username
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def encrypt_options(self):
"""
Returns the value of the `encrypt_options` property.
"""
return self._encrypt_options
@encrypt_options.setter
def encrypt_options(self, value):
"""
Sets the value of the `encrypt_options` property.
"""
self._encrypt_options = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def concurrent(self):
"""
Returns the value of the `concurrent` property.
"""
return self._concurrent
@concurrent.setter
def concurrent(self, value):
"""
Sets the value of the `concurrent` property.
"""
self._concurrent = value
@property
def options(self):
"""
Returns the value of the `options` property.
"""
return self._options
@options.setter
def options(self, value):
"""
Sets the value of the `options` property.
"""
self._options = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def order(self):
"""
Returns the value of the `order` property.
"""
return self._order
@order.setter
def order(self, value):
"""
Sets the value of the `order` property.
"""
self._order = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
class Application(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
vm=None,
):
super(Application, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.vm = vm
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
class AuthorizedKey(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
key=None,
name=None,
user=None,
):
super(AuthorizedKey, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.key = key
self.user = user
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def key(self):
"""
Returns the value of the `key` property.
"""
return self._key
@key.setter
def key(self, value):
"""
Sets the value of the `key` property.
"""
self._key = value
class Backup(Identified):
def __init__(
self,
comment=None,
creation_date=None,
description=None,
disks=None,
from_checkpoint_id=None,
host=None,
id=None,
modification_date=None,
name=None,
phase=None,
snapshot=None,
to_checkpoint_id=None,
vm=None,
):
super(Backup, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.creation_date = creation_date
self.disks = disks
self.from_checkpoint_id = from_checkpoint_id
self.host = host
self.modification_date = modification_date
self.phase = phase
self.snapshot = snapshot
self.to_checkpoint_id = to_checkpoint_id
self.vm = vm
@property
def phase(self):
"""
Returns the value of the `phase` property.
"""
return self._phase
@phase.setter
def phase(self, value):
"""
Sets the value of the `phase` property.
"""
Struct._check_type('phase', value, BackupPhase)
self._phase = value
@property
def to_checkpoint_id(self):
"""
Returns the value of the `to_checkpoint_id` property.
"""
return self._to_checkpoint_id
@to_checkpoint_id.setter
def to_checkpoint_id(self, value):
"""
Sets the value of the `to_checkpoint_id` property.
"""
self._to_checkpoint_id = value
@property
def modification_date(self):
"""
Returns the value of the `modification_date` property.
"""
return self._modification_date
@modification_date.setter
def modification_date(self, value):
"""
Sets the value of the `modification_date` property.
"""
self._modification_date = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def from_checkpoint_id(self):
"""
Returns the value of the `from_checkpoint_id` property.
"""
return self._from_checkpoint_id
@from_checkpoint_id.setter
def from_checkpoint_id(self, value):
"""
Sets the value of the `from_checkpoint_id` property.
"""
self._from_checkpoint_id = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def disks(self):
"""
Returns the value of the `disks` property.
"""
return self._disks
@disks.setter
def disks(self, value):
"""
Sets the value of the `disks` property.
"""
self._disks = value
@property
def snapshot(self):
"""
Returns the value of the `snapshot` property.
"""
return self._snapshot
@snapshot.setter
def snapshot(self, value):
"""
Sets the value of the `snapshot` property.
"""
Struct._check_type('snapshot', value, Snapshot)
self._snapshot = value
@property
def creation_date(self):
"""
Returns the value of the `creation_date` property.
"""
return self._creation_date
@creation_date.setter
def creation_date(self, value):
"""
Sets the value of the `creation_date` property.
"""
self._creation_date = value
class Balance(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
scheduling_policy=None,
scheduling_policy_unit=None,
):
super(Balance, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.scheduling_policy = scheduling_policy
self.scheduling_policy_unit = scheduling_policy_unit
@property
def scheduling_policy(self):
"""
Returns the value of the `scheduling_policy` property.
"""
return self._scheduling_policy
@scheduling_policy.setter
def scheduling_policy(self, value):
"""
Sets the value of the `scheduling_policy` property.
"""
Struct._check_type('scheduling_policy', value, SchedulingPolicy)
self._scheduling_policy = value
@property
def scheduling_policy_unit(self):
"""
Returns the value of the `scheduling_policy_unit` property.
"""
return self._scheduling_policy_unit
@scheduling_policy_unit.setter
def scheduling_policy_unit(self, value):
"""
Sets the value of the `scheduling_policy_unit` property.
"""
Struct._check_type('scheduling_policy_unit', value, SchedulingPolicyUnit)
self._scheduling_policy_unit = value
class Bookmark(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
value=None,
):
super(Bookmark, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.value = value
@property
def value(self):
"""
Returns the value of the `value` property.
"""
return self._value
@value.setter
def value(self, value):
"""
Sets the value of the `value` property.
"""
self._value = value
class BrickProfileDetail(EntityProfileDetail):
def __init__(
self,
brick=None,
profile_details=None,
):
super(BrickProfileDetail, self).__init__(
profile_details=profile_details,
)
self.brick = brick
@property
def brick(self):
"""
Returns the value of the `brick` property.
"""
return self._brick
@brick.setter
def brick(self, value):
"""
Sets the value of the `brick` property.
"""
Struct._check_type('brick', value, GlusterBrick)
self._brick = value
class Certificate(Identified):
def __init__(
self,
comment=None,
content=None,
description=None,
id=None,
name=None,
organization=None,
subject=None,
):
super(Certificate, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.content = content
self.organization = organization
self.subject = subject
@property
def subject(self):
"""
Returns the value of the `subject` property.
"""
return self._subject
@subject.setter
def subject(self, value):
"""
Sets the value of the `subject` property.
"""
self._subject = value
@property
def organization(self):
"""
Returns the value of the `organization` property.
"""
return self._organization
@organization.setter
def organization(self, value):
"""
Sets the value of the `organization` property.
"""
self._organization = value
@property
def content(self):
"""
Returns the value of the `content` property.
"""
return self._content
@content.setter
def content(self, value):
"""
Sets the value of the `content` property.
"""
self._content = value
class Checkpoint(Identified):
def __init__(
self,
comment=None,
creation_date=None,
description=None,
disks=None,
id=None,
name=None,
parent_id=None,
state=None,
vm=None,
):
super(Checkpoint, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.creation_date = creation_date
self.disks = disks
self.parent_id = parent_id
self.state = state
self.vm = vm
@property
def parent_id(self):
"""
Returns the value of the `parent_id` property.
"""
return self._parent_id
@parent_id.setter
def parent_id(self, value):
"""
Sets the value of the `parent_id` property.
"""
self._parent_id = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def disks(self):
"""
Returns the value of the `disks` property.
"""
return self._disks
@disks.setter
def disks(self, value):
"""
Sets the value of the `disks` property.
"""
self._disks = value
@property
def state(self):
"""
Returns the value of the `state` property.
"""
return self._state
@state.setter
def state(self, value):
"""
Sets the value of the `state` property.
"""
Struct._check_type('state', value, CheckpointState)
self._state = value
@property
def creation_date(self):
"""
Returns the value of the `creation_date` property.
"""
return self._creation_date
@creation_date.setter
def creation_date(self, value):
"""
Sets the value of the `creation_date` property.
"""
self._creation_date = value
class Cluster(Identified):
def __init__(
self,
affinity_groups=None,
ballooning_enabled=None,
bios_type=None,
comment=None,
cpu=None,
cpu_profiles=None,
custom_scheduling_policy_properties=None,
data_center=None,
description=None,
display=None,
enabled_features=None,
error_handling=None,
external_network_providers=None,
fencing_policy=None,
fips_mode=None,
firewall_type=None,
gluster_hooks=None,
gluster_service=None,
gluster_tuned_profile=None,
gluster_volumes=None,
ha_reservation=None,
id=None,
ksm=None,
log_max_memory_used_threshold=None,
log_max_memory_used_threshold_type=None,
mac_pool=None,
maintenance_reason_required=None,
management_network=None,
memory_policy=None,
migration=None,
name=None,
network_filters=None,
networks=None,
optional_reason=None,
permissions=None,
required_rng_sources=None,
scheduling_policy=None,
serial_number=None,
supported_versions=None,
switch_type=None,
threads_as_cores=None,
trusted_service=None,
tunnel_migration=None,
upgrade_correlation_id=None,
upgrade_in_progress=None,
upgrade_percent_complete=None,
version=None,
virt_service=None,
vnc_encryption=None,
):
super(Cluster, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.affinity_groups = affinity_groups
self.ballooning_enabled = ballooning_enabled
self.bios_type = bios_type
self.cpu = cpu
self.cpu_profiles = cpu_profiles
self.custom_scheduling_policy_properties = custom_scheduling_policy_properties
self.data_center = data_center
self.display = display
self.enabled_features = enabled_features
self.error_handling = error_handling
self.external_network_providers = external_network_providers
self.fencing_policy = fencing_policy
self.fips_mode = fips_mode
self.firewall_type = firewall_type
self.gluster_hooks = gluster_hooks
self.gluster_service = gluster_service
self.gluster_tuned_profile = gluster_tuned_profile
self.gluster_volumes = gluster_volumes
self.ha_reservation = ha_reservation
self.ksm = ksm
self.log_max_memory_used_threshold = log_max_memory_used_threshold
self.log_max_memory_used_threshold_type = log_max_memory_used_threshold_type
self.mac_pool = mac_pool
self.maintenance_reason_required = maintenance_reason_required
self.management_network = management_network
self.memory_policy = memory_policy
self.migration = migration
self.network_filters = network_filters
self.networks = networks
self.optional_reason = optional_reason
self.permissions = permissions
self.required_rng_sources = required_rng_sources
self.scheduling_policy = scheduling_policy
self.serial_number = serial_number
self.supported_versions = supported_versions
self.switch_type = switch_type
self.threads_as_cores = threads_as_cores
self.trusted_service = trusted_service
self.tunnel_migration = tunnel_migration
self.upgrade_correlation_id = upgrade_correlation_id
self.upgrade_in_progress = upgrade_in_progress
self.upgrade_percent_complete = upgrade_percent_complete
self.version = version
self.virt_service = virt_service
self.vnc_encryption = vnc_encryption
@property
def serial_number(self):
"""
Returns the value of the `serial_number` property.
"""
return self._serial_number
@serial_number.setter
def serial_number(self, value):
"""
Sets the value of the `serial_number` property.
"""
Struct._check_type('serial_number', value, SerialNumber)
self._serial_number = value
@property
def threads_as_cores(self):
"""
Returns the value of the `threads_as_cores` property.
"""
return self._threads_as_cores
@threads_as_cores.setter
def threads_as_cores(self, value):
"""
Sets the value of the `threads_as_cores` property.
"""
self._threads_as_cores = value
@property
def gluster_volumes(self):
"""
Returns the value of the `gluster_volumes` property.
"""
return self._gluster_volumes
@gluster_volumes.setter
def gluster_volumes(self, value):
"""
Sets the value of the `gluster_volumes` property.
"""
self._gluster_volumes = value
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
@property
def upgrade_correlation_id(self):
"""
Returns the value of the `upgrade_correlation_id` property.
"""
return self._upgrade_correlation_id
@upgrade_correlation_id.setter
def upgrade_correlation_id(self, value):
"""
Sets the value of the `upgrade_correlation_id` property.
"""
self._upgrade_correlation_id = value
@property
def display(self):
"""
Returns the value of the `display` property.
"""
return self._display
@display.setter
def display(self, value):
"""
Sets the value of the `display` property.
"""
Struct._check_type('display', value, Display)
self._display = value
@property
def ballooning_enabled(self):
"""
Returns the value of the `ballooning_enabled` property.
"""
return self._ballooning_enabled
@ballooning_enabled.setter
def ballooning_enabled(self, value):
"""
Sets the value of the `ballooning_enabled` property.
"""
self._ballooning_enabled = value
@property
def cpu(self):
"""
Returns the value of the `cpu` property.
"""
return self._cpu
@cpu.setter
def cpu(self, value):
"""
Sets the value of the `cpu` property.
"""
Struct._check_type('cpu', value, Cpu)
self._cpu = value
@property
def log_max_memory_used_threshold(self):
"""
Returns the value of the `log_max_memory_used_threshold` property.
"""
return self._log_max_memory_used_threshold
@log_max_memory_used_threshold.setter
def log_max_memory_used_threshold(self, value):
"""
Sets the value of the `log_max_memory_used_threshold` property.
"""
self._log_max_memory_used_threshold = value
@property
def external_network_providers(self):
"""
Returns the value of the `external_network_providers` property.
"""
return self._external_network_providers
@external_network_providers.setter
def external_network_providers(self, value):
"""
Sets the value of the `external_network_providers` property.
"""
self._external_network_providers = value
@property
def mac_pool(self):
"""
Returns the value of the `mac_pool` property.
"""
return self._mac_pool
@mac_pool.setter
def mac_pool(self, value):
"""
Sets the value of the `mac_pool` property.
"""
Struct._check_type('mac_pool', value, MacPool)
self._mac_pool = value
@property
def firewall_type(self):
"""
Returns the value of the `firewall_type` property.
"""
return self._firewall_type
@firewall_type.setter
def firewall_type(self, value):
"""
Sets the value of the `firewall_type` property.
"""
Struct._check_type('firewall_type', value, FirewallType)
self._firewall_type = value
@property
def upgrade_percent_complete(self):
"""
Returns the value of the `upgrade_percent_complete` property.
"""
return self._upgrade_percent_complete
@upgrade_percent_complete.setter
def upgrade_percent_complete(self, value):
"""
Sets the value of the `upgrade_percent_complete` property.
"""
self._upgrade_percent_complete = value
@property
def required_rng_sources(self):
"""
Returns the value of the `required_rng_sources` property.
"""
return self._required_rng_sources
@required_rng_sources.setter
def required_rng_sources(self, value):
"""
Sets the value of the `required_rng_sources` property.
"""
self._required_rng_sources = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def memory_policy(self):
"""
Returns the value of the `memory_policy` property.
"""
return self._memory_policy
@memory_policy.setter
def memory_policy(self, value):
"""
Sets the value of the `memory_policy` property.
"""
Struct._check_type('memory_policy', value, MemoryPolicy)
self._memory_policy = value
@property
def fencing_policy(self):
"""
Returns the value of the `fencing_policy` property.
"""
return self._fencing_policy
@fencing_policy.setter
def fencing_policy(self, value):
"""
Sets the value of the `fencing_policy` property.
"""
Struct._check_type('fencing_policy', value, FencingPolicy)
self._fencing_policy = value
@property
def enabled_features(self):
"""
Returns the value of the `enabled_features` property.
"""
return self._enabled_features
@enabled_features.setter
def enabled_features(self, value):
"""
Sets the value of the `enabled_features` property.
"""
self._enabled_features = value
@property
def network_filters(self):
"""
Returns the value of the `network_filters` property.
"""
return self._network_filters
@network_filters.setter
def network_filters(self, value):
"""
Sets the value of the `network_filters` property.
"""
self._network_filters = value
@property
def virt_service(self):
"""
Returns the value of the `virt_service` property.
"""
return self._virt_service
@virt_service.setter
def virt_service(self, value):
"""
Sets the value of the `virt_service` property.
"""
self._virt_service = value
@property
def tunnel_migration(self):
"""
Returns the value of the `tunnel_migration` property.
"""
return self._tunnel_migration
@tunnel_migration.setter
def tunnel_migration(self, value):
"""
Sets the value of the `tunnel_migration` property.
"""
self._tunnel_migration = value
@property
def gluster_service(self):
"""
Returns the value of the `gluster_service` property.
"""
return self._gluster_service
@gluster_service.setter
def gluster_service(self, value):
"""
Sets the value of the `gluster_service` property.
"""
self._gluster_service = value
@property
def trusted_service(self):
"""
Returns the value of the `trusted_service` property.
"""
return self._trusted_service
@trusted_service.setter
def trusted_service(self, value):
"""
Sets the value of the `trusted_service` property.
"""
self._trusted_service = value
@property
def migration(self):
"""
Returns the value of the `migration` property.
"""
return self._migration
@migration.setter
def migration(self, value):
"""
Sets the value of the `migration` property.
"""
Struct._check_type('migration', value, MigrationOptions)
self._migration = value
@property
def fips_mode(self):
"""
Returns the value of the `fips_mode` property.
"""
return self._fips_mode
@fips_mode.setter
def fips_mode(self, value):
"""
Sets the value of the `fips_mode` property.
"""
Struct._check_type('fips_mode', value, FipsMode)
self._fips_mode = value
@property
def optional_reason(self):
"""
Returns the value of the `optional_reason` property.
"""
return self._optional_reason
@optional_reason.setter
def optional_reason(self, value):
"""
Sets the value of the `optional_reason` property.
"""
self._optional_reason = value
@property
def ha_reservation(self):
"""
Returns the value of the `ha_reservation` property.
"""
return self._ha_reservation
@ha_reservation.setter
def ha_reservation(self, value):
"""
Sets the value of the `ha_reservation` property.
"""
self._ha_reservation = value
@property
def ksm(self):
"""
Returns the value of the `ksm` property.
"""
return self._ksm
@ksm.setter
def ksm(self, value):
"""
Sets the value of the `ksm` property.
"""
Struct._check_type('ksm', value, Ksm)
self._ksm = value
@property
def log_max_memory_used_threshold_type(self):
"""
Returns the value of the `log_max_memory_used_threshold_type` property.
"""
return self._log_max_memory_used_threshold_type
@log_max_memory_used_threshold_type.setter
def log_max_memory_used_threshold_type(self, value):
"""
Sets the value of the `log_max_memory_used_threshold_type` property.
"""
Struct._check_type('log_max_memory_used_threshold_type', value, LogMaxMemoryUsedThresholdType)
self._log_max_memory_used_threshold_type = value
@property
def affinity_groups(self):
"""
Returns the value of the `affinity_groups` property.
"""
return self._affinity_groups
@affinity_groups.setter
def affinity_groups(self, value):
"""
Sets the value of the `affinity_groups` property.
"""
self._affinity_groups = value
@property
def gluster_hooks(self):
"""
Returns the value of the `gluster_hooks` property.
"""
return self._gluster_hooks
@gluster_hooks.setter
def gluster_hooks(self, value):
"""
Sets the value of the `gluster_hooks` property.
"""
self._gluster_hooks = value
@property
def error_handling(self):
"""
Returns the value of the `error_handling` property.
"""
return self._error_handling
@error_handling.setter
def error_handling(self, value):
"""
Sets the value of the `error_handling` property.
"""
Struct._check_type('error_handling', value, ErrorHandling)
self._error_handling = value
@property
def networks(self):
"""
Returns the value of the `networks` property.
"""
return self._networks
@networks.setter
def networks(self, value):
"""
Sets the value of the `networks` property.
"""
self._networks = value
@property
def gluster_tuned_profile(self):
"""
Returns the value of the `gluster_tuned_profile` property.
"""
return self._gluster_tuned_profile
@gluster_tuned_profile.setter
def gluster_tuned_profile(self, value):
"""
Sets the value of the `gluster_tuned_profile` property.
"""
self._gluster_tuned_profile = value
@property
def maintenance_reason_required(self):
"""
Returns the value of the `maintenance_reason_required` property.
"""
return self._maintenance_reason_required
@maintenance_reason_required.setter
def maintenance_reason_required(self, value):
"""
Sets the value of the `maintenance_reason_required` property.
"""
self._maintenance_reason_required = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def upgrade_in_progress(self):
"""
Returns the value of the `upgrade_in_progress` property.
"""
return self._upgrade_in_progress
@upgrade_in_progress.setter
def upgrade_in_progress(self, value):
"""
Sets the value of the `upgrade_in_progress` property.
"""
self._upgrade_in_progress = value
@property
def scheduling_policy(self):
"""
Returns the value of the `scheduling_policy` property.
"""
return self._scheduling_policy
@scheduling_policy.setter
def scheduling_policy(self, value):
"""
Sets the value of the `scheduling_policy` property.
"""
Struct._check_type('scheduling_policy', value, SchedulingPolicy)
self._scheduling_policy = value
@property
def cpu_profiles(self):
"""
Returns the value of the `cpu_profiles` property.
"""
return self._cpu_profiles
@cpu_profiles.setter
def cpu_profiles(self, value):
"""
Sets the value of the `cpu_profiles` property.
"""
self._cpu_profiles = value
@property
def management_network(self):
"""
Returns the value of the `management_network` property.
"""
return self._management_network
@management_network.setter
def management_network(self, value):
"""
Sets the value of the `management_network` property.
"""
Struct._check_type('management_network', value, Network)
self._management_network = value
@property
def switch_type(self):
"""
Returns the value of the `switch_type` property.
"""
return self._switch_type
@switch_type.setter
def switch_type(self, value):
"""
Sets the value of the `switch_type` property.
"""
Struct._check_type('switch_type', value, SwitchType)
self._switch_type = value
@property
def vnc_encryption(self):
"""
Returns the value of the `vnc_encryption` property.
"""
return self._vnc_encryption
@vnc_encryption.setter
def vnc_encryption(self, value):
"""
Sets the value of the `vnc_encryption` property.
"""
self._vnc_encryption = value
@property
def supported_versions(self):
"""
Returns the value of the `supported_versions` property.
"""
return self._supported_versions
@supported_versions.setter
def supported_versions(self, value):
"""
Sets the value of the `supported_versions` property.
"""
self._supported_versions = value
@property
def bios_type(self):
"""
Returns the value of the `bios_type` property.
"""
return self._bios_type
@bios_type.setter
def bios_type(self, value):
"""
Sets the value of the `bios_type` property.
"""
Struct._check_type('bios_type', value, BiosType)
self._bios_type = value
@property
def custom_scheduling_policy_properties(self):
"""
Returns the value of the `custom_scheduling_policy_properties` property.
"""
return self._custom_scheduling_policy_properties
@custom_scheduling_policy_properties.setter
def custom_scheduling_policy_properties(self, value):
"""
Sets the value of the `custom_scheduling_policy_properties` property.
"""
self._custom_scheduling_policy_properties = value
class ClusterFeature(Identified):
def __init__(
self,
cluster_level=None,
comment=None,
description=None,
id=None,
name=None,
):
super(ClusterFeature, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster_level = cluster_level
@property
def cluster_level(self):
"""
Returns the value of the `cluster_level` property.
"""
return self._cluster_level
@cluster_level.setter
def cluster_level(self, value):
"""
Sets the value of the `cluster_level` property.
"""
Struct._check_type('cluster_level', value, ClusterLevel)
self._cluster_level = value
class ClusterLevel(Identified):
def __init__(
self,
cluster_features=None,
comment=None,
cpu_types=None,
description=None,
id=None,
name=None,
permits=None,
):
super(ClusterLevel, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster_features = cluster_features
self.cpu_types = cpu_types
self.permits = permits
@property
def cluster_features(self):
"""
Returns the value of the `cluster_features` property.
"""
return self._cluster_features
@cluster_features.setter
def cluster_features(self, value):
"""
Sets the value of the `cluster_features` property.
"""
self._cluster_features = value
@property
def cpu_types(self):
"""
Returns the value of the `cpu_types` property.
"""
return self._cpu_types
@cpu_types.setter
def cpu_types(self, value):
"""
Sets the value of the `cpu_types` property.
"""
self._cpu_types = value
@property
def permits(self):
"""
Returns the value of the `permits` property.
"""
return self._permits
@permits.setter
def permits(self, value):
"""
Sets the value of the `permits` property.
"""
self._permits = value
class CpuProfile(Identified):
def __init__(
self,
cluster=None,
comment=None,
description=None,
id=None,
name=None,
permissions=None,
qos=None,
):
super(CpuProfile, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster = cluster
self.permissions = permissions
self.qos = qos
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def qos(self):
"""
Returns the value of the `qos` property.
"""
return self._qos
@qos.setter
def qos(self, value):
"""
Sets the value of the `qos` property.
"""
Struct._check_type('qos', value, Qos)
self._qos = value
class DataCenter(Identified):
def __init__(
self,
clusters=None,
comment=None,
description=None,
id=None,
iscsi_bonds=None,
local=None,
mac_pool=None,
name=None,
networks=None,
permissions=None,
qoss=None,
quota_mode=None,
quotas=None,
status=None,
storage_domains=None,
storage_format=None,
supported_versions=None,
version=None,
):
super(DataCenter, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.clusters = clusters
self.iscsi_bonds = iscsi_bonds
self.local = local
self.mac_pool = mac_pool
self.networks = networks
self.permissions = permissions
self.qoss = qoss
self.quota_mode = quota_mode
self.quotas = quotas
self.status = status
self.storage_domains = storage_domains
self.storage_format = storage_format
self.supported_versions = supported_versions
self.version = version
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
@property
def quotas(self):
"""
Returns the value of the `quotas` property.
"""
return self._quotas
@quotas.setter
def quotas(self, value):
"""
Sets the value of the `quotas` property.
"""
self._quotas = value
@property
def storage_format(self):
"""
Returns the value of the `storage_format` property.
"""
return self._storage_format
@storage_format.setter
def storage_format(self, value):
"""
Sets the value of the `storage_format` property.
"""
Struct._check_type('storage_format', value, StorageFormat)
self._storage_format = value
@property
def quota_mode(self):
"""
Returns the value of the `quota_mode` property.
"""
return self._quota_mode
@quota_mode.setter
def quota_mode(self, value):
"""
Sets the value of the `quota_mode` property.
"""
Struct._check_type('quota_mode', value, QuotaModeType)
self._quota_mode = value
@property
def qoss(self):
"""
Returns the value of the `qoss` property.
"""
return self._qoss
@qoss.setter
def qoss(self, value):
"""
Sets the value of the `qoss` property.
"""
self._qoss = value
@property
def mac_pool(self):
"""
Returns the value of the `mac_pool` property.
"""
return self._mac_pool
@mac_pool.setter
def mac_pool(self, value):
"""
Sets the value of the `mac_pool` property.
"""
Struct._check_type('mac_pool', value, MacPool)
self._mac_pool = value
@property
def storage_domains(self):
"""
Returns the value of the `storage_domains` property.
"""
return self._storage_domains
@storage_domains.setter
def storage_domains(self, value):
"""
Sets the value of the `storage_domains` property.
"""
self._storage_domains = value
@property
def iscsi_bonds(self):
"""
Returns the value of the `iscsi_bonds` property.
"""
return self._iscsi_bonds
@iscsi_bonds.setter
def iscsi_bonds(self, value):
"""
Sets the value of the `iscsi_bonds` property.
"""
self._iscsi_bonds = value
@property
def networks(self):
"""
Returns the value of the `networks` property.
"""
return self._networks
@networks.setter
def networks(self, value):
"""
Sets the value of the `networks` property.
"""
self._networks = value
@property
def local(self):
"""
Returns the value of the `local` property.
"""
return self._local
@local.setter
def local(self, value):
"""
Sets the value of the `local` property.
"""
self._local = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def supported_versions(self):
"""
Returns the value of the `supported_versions` property.
"""
return self._supported_versions
@supported_versions.setter
def supported_versions(self, value):
"""
Sets the value of the `supported_versions` property.
"""
self._supported_versions = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, DataCenterStatus)
self._status = value
@property
def clusters(self):
"""
Returns the value of the `clusters` property.
"""
return self._clusters
@clusters.setter
def clusters(self, value):
"""
Sets the value of the `clusters` property.
"""
self._clusters = value
class Device(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
instance_type=None,
name=None,
template=None,
vm=None,
vms=None,
):
super(Device, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.instance_type = instance_type
self.template = template
self.vm = vm
self.vms = vms
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def instance_type(self):
"""
Returns the value of the `instance_type` property.
"""
return self._instance_type
@instance_type.setter
def instance_type(self, value):
"""
Sets the value of the `instance_type` property.
"""
Struct._check_type('instance_type', value, InstanceType)
self._instance_type = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def vms(self):
"""
Returns the value of the `vms` property.
"""
return self._vms
@vms.setter
def vms(self, value):
"""
Sets the value of the `vms` property.
"""
self._vms = value
class Disk(Device):
def __init__(
self,
active=None,
actual_size=None,
alias=None,
backup=None,
backup_mode=None,
bootable=None,
comment=None,
content_type=None,
description=None,
disk_profile=None,
disk_snapshots=None,
external_disk=None,
format=None,
id=None,
image_id=None,
initial_size=None,
instance_type=None,
interface=None,
logical_name=None,
lun_storage=None,
name=None,
openstack_volume_type=None,
permissions=None,
propagate_errors=None,
provisioned_size=None,
qcow_version=None,
quota=None,
read_only=None,
sgio=None,
shareable=None,
snapshot=None,
sparse=None,
statistics=None,
status=None,
storage_domain=None,
storage_domains=None,
storage_type=None,
template=None,
total_size=None,
uses_scsi_reservation=None,
vm=None,
vms=None,
wipe_after_delete=None,
):
super(Disk, self).__init__(
comment=comment,
description=description,
id=id,
instance_type=instance_type,
name=name,
template=template,
vm=vm,
vms=vms,
)
self.active = active
self.actual_size = actual_size
self.alias = alias
self.backup = backup
self.backup_mode = backup_mode
self.bootable = bootable
self.content_type = content_type
self.disk_profile = disk_profile
self.disk_snapshots = disk_snapshots
self.external_disk = external_disk
self.format = format
self.image_id = image_id
self.initial_size = initial_size
self.interface = interface
self.logical_name = logical_name
self.lun_storage = lun_storage
self.openstack_volume_type = openstack_volume_type
self.permissions = permissions
self.propagate_errors = propagate_errors
self.provisioned_size = provisioned_size
self.qcow_version = qcow_version
self.quota = quota
self.read_only = read_only
self.sgio = sgio
self.shareable = shareable
self.snapshot = snapshot
self.sparse = sparse
self.statistics = statistics
self.status = status
self.storage_domain = storage_domain
self.storage_domains = storage_domains
self.storage_type = storage_type
self.total_size = total_size
self.uses_scsi_reservation = uses_scsi_reservation
self.wipe_after_delete = wipe_after_delete
@property
def initial_size(self):
"""
Returns the value of the `initial_size` property.
"""
return self._initial_size
@initial_size.setter
def initial_size(self, value):
"""
Sets the value of the `initial_size` property.
"""
self._initial_size = value
@property
def qcow_version(self):
"""
Returns the value of the `qcow_version` property.
"""
return self._qcow_version
@qcow_version.setter
def qcow_version(self, value):
"""
Sets the value of the `qcow_version` property.
"""
Struct._check_type('qcow_version', value, QcowVersion)
self._qcow_version = value
@property
def total_size(self):
"""
Returns the value of the `total_size` property.
"""
return self._total_size
@total_size.setter
def total_size(self, value):
"""
Sets the value of the `total_size` property.
"""
self._total_size = value
@property
def content_type(self):
"""
Returns the value of the `content_type` property.
"""
return self._content_type
@content_type.setter
def content_type(self, value):
"""
Sets the value of the `content_type` property.
"""
Struct._check_type('content_type', value, DiskContentType)
self._content_type = value
@property
def format(self):
"""
Returns the value of the `format` property.
"""
return self._format
@format.setter
def format(self, value):
"""
Sets the value of the `format` property.
"""
Struct._check_type('format', value, DiskFormat)
self._format = value
@property
def active(self):
"""
Returns the value of the `active` property.
"""
return self._active
@active.setter
def active(self, value):
"""
Sets the value of the `active` property.
"""
self._active = value
@property
def storage_domains(self):
"""
Returns the value of the `storage_domains` property.
"""
return self._storage_domains
@storage_domains.setter
def storage_domains(self, value):
"""
Sets the value of the `storage_domains` property.
"""
self._storage_domains = value
@property
def actual_size(self):
"""
Returns the value of the `actual_size` property.
"""
return self._actual_size
@actual_size.setter
def actual_size(self, value):
"""
Sets the value of the `actual_size` property.
"""
self._actual_size = value
@property
def propagate_errors(self):
"""
Returns the value of the `propagate_errors` property.
"""
return self._propagate_errors
@propagate_errors.setter
def propagate_errors(self, value):
"""
Sets the value of the `propagate_errors` property.
"""
self._propagate_errors = value
@property
def external_disk(self):
"""
Returns the value of the `external_disk` property.
"""
return self._external_disk
@external_disk.setter
def external_disk(self, value):
"""
Sets the value of the `external_disk` property.
"""
self._external_disk = value
@property
def uses_scsi_reservation(self):
"""
Returns the value of the `uses_scsi_reservation` property.
"""
return self._uses_scsi_reservation
@uses_scsi_reservation.setter
def uses_scsi_reservation(self, value):
"""
Sets the value of the `uses_scsi_reservation` property.
"""
self._uses_scsi_reservation = value
@property
def snapshot(self):
"""
Returns the value of the `snapshot` property.
"""
return self._snapshot
@snapshot.setter
def snapshot(self, value):
"""
Sets the value of the `snapshot` property.
"""
Struct._check_type('snapshot', value, Snapshot)
self._snapshot = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, DiskStatus)
self._status = value
@property
def logical_name(self):
"""
Returns the value of the `logical_name` property.
"""
return self._logical_name
@logical_name.setter
def logical_name(self, value):
"""
Sets the value of the `logical_name` property.
"""
self._logical_name = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
@property
def shareable(self):
"""
Returns the value of the `shareable` property.
"""
return self._shareable
@shareable.setter
def shareable(self, value):
"""
Sets the value of the `shareable` property.
"""
self._shareable = value
@property
def backup(self):
"""
Returns the value of the `backup` property.
"""
return self._backup
@backup.setter
def backup(self, value):
"""
Sets the value of the `backup` property.
"""
Struct._check_type('backup', value, DiskBackup)
self._backup = value
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def disk_snapshots(self):
"""
Returns the value of the `disk_snapshots` property.
"""
return self._disk_snapshots
@disk_snapshots.setter
def disk_snapshots(self, value):
"""
Sets the value of the `disk_snapshots` property.
"""
self._disk_snapshots = value
@property
def provisioned_size(self):
"""
Returns the value of the `provisioned_size` property.
"""
return self._provisioned_size
@provisioned_size.setter
def provisioned_size(self, value):
"""
Sets the value of the `provisioned_size` property.
"""
self._provisioned_size = value
@property
def backup_mode(self):
"""
Returns the value of the `backup_mode` property.
"""
return self._backup_mode
@backup_mode.setter
def backup_mode(self, value):
"""
Sets the value of the `backup_mode` property.
"""
Struct._check_type('backup_mode', value, DiskBackupMode)
self._backup_mode = value
@property
def openstack_volume_type(self):
"""
Returns the value of the `openstack_volume_type` property.
"""
return self._openstack_volume_type
@openstack_volume_type.setter
def openstack_volume_type(self, value):
"""
Sets the value of the `openstack_volume_type` property.
"""
Struct._check_type('openstack_volume_type', value, OpenStackVolumeType)
self._openstack_volume_type = value
@property
def alias(self):
"""
Returns the value of the `alias` property.
"""
return self._alias
@alias.setter
def alias(self, value):
"""
Sets the value of the `alias` property.
"""
self._alias = value
@property
def sparse(self):
"""
Returns the value of the `sparse` property.
"""
return self._sparse
@sparse.setter
def sparse(self, value):
"""
Sets the value of the `sparse` property.
"""
self._sparse = value
@property
def bootable(self):
"""
Returns the value of the `bootable` property.
"""
return self._bootable
@bootable.setter
def bootable(self, value):
"""
Sets the value of the `bootable` property.
"""
self._bootable = value
@property
def sgio(self):
"""
Returns the value of the `sgio` property.
"""
return self._sgio
@sgio.setter
def sgio(self, value):
"""
Sets the value of the `sgio` property.
"""
Struct._check_type('sgio', value, ScsiGenericIO)
self._sgio = value
@property
def disk_profile(self):
"""
Returns the value of the `disk_profile` property.
"""
return self._disk_profile
@disk_profile.setter
def disk_profile(self, value):
"""
Sets the value of the `disk_profile` property.
"""
Struct._check_type('disk_profile', value, DiskProfile)
self._disk_profile = value
@property
def interface(self):
"""
Returns the value of the `interface` property.
"""
return self._interface
@interface.setter
def interface(self, value):
"""
Sets the value of the `interface` property.
"""
Struct._check_type('interface', value, DiskInterface)
self._interface = value
@property
def storage_type(self):
"""
Returns the value of the `storage_type` property.
"""
return self._storage_type
@storage_type.setter
def storage_type(self, value):
"""
Sets the value of the `storage_type` property.
"""
Struct._check_type('storage_type', value, DiskStorageType)
self._storage_type = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def lun_storage(self):
"""
Returns the value of the `lun_storage` property.
"""
return self._lun_storage
@lun_storage.setter
def lun_storage(self, value):
"""
Sets the value of the `lun_storage` property.
"""
Struct._check_type('lun_storage', value, HostStorage)
self._lun_storage = value
@property
def wipe_after_delete(self):
"""
Returns the value of the `wipe_after_delete` property.
"""
return self._wipe_after_delete
@wipe_after_delete.setter
def wipe_after_delete(self, value):
"""
Sets the value of the `wipe_after_delete` property.
"""
self._wipe_after_delete = value
@property
def quota(self):
"""
Returns the value of the `quota` property.
"""
return self._quota
@quota.setter
def quota(self, value):
"""
Sets the value of the `quota` property.
"""
Struct._check_type('quota', value, Quota)
self._quota = value
@property
def image_id(self):
"""
Returns the value of the `image_id` property.
"""
return self._image_id
@image_id.setter
def image_id(self, value):
"""
Sets the value of the `image_id` property.
"""
self._image_id = value
@property
def read_only(self):
"""
Returns the value of the `read_only` property.
"""
return self._read_only
@read_only.setter
def read_only(self, value):
"""
Sets the value of the `read_only` property.
"""
self._read_only = value
class DiskAttachment(Identified):
def __init__(
self,
active=None,
bootable=None,
comment=None,
description=None,
disk=None,
id=None,
interface=None,
logical_name=None,
name=None,
pass_discard=None,
read_only=None,
template=None,
uses_scsi_reservation=None,
vm=None,
):
super(DiskAttachment, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.active = active
self.bootable = bootable
self.disk = disk
self.interface = interface
self.logical_name = logical_name
self.pass_discard = pass_discard
self.read_only = read_only
self.template = template
self.uses_scsi_reservation = uses_scsi_reservation
self.vm = vm
@property
def disk(self):
"""
Returns the value of the `disk` property.
"""
return self._disk
@disk.setter
def disk(self, value):
"""
Sets the value of the `disk` property.
"""
Struct._check_type('disk', value, Disk)
self._disk = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def uses_scsi_reservation(self):
"""
Returns the value of the `uses_scsi_reservation` property.
"""
return self._uses_scsi_reservation
@uses_scsi_reservation.setter
def uses_scsi_reservation(self, value):
"""
Sets the value of the `uses_scsi_reservation` property.
"""
self._uses_scsi_reservation = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def pass_discard(self):
"""
Returns the value of the `pass_discard` property.
"""
return self._pass_discard
@pass_discard.setter
def pass_discard(self, value):
"""
Sets the value of the `pass_discard` property.
"""
self._pass_discard = value
@property
def bootable(self):
"""
Returns the value of the `bootable` property.
"""
return self._bootable
@bootable.setter
def bootable(self, value):
"""
Sets the value of the `bootable` property.
"""
self._bootable = value
@property
def active(self):
"""
Returns the value of the `active` property.
"""
return self._active
@active.setter
def active(self, value):
"""
Sets the value of the `active` property.
"""
self._active = value
@property
def logical_name(self):
"""
Returns the value of the `logical_name` property.
"""
return self._logical_name
@logical_name.setter
def logical_name(self, value):
"""
Sets the value of the `logical_name` property.
"""
self._logical_name = value
@property
def interface(self):
"""
Returns the value of the `interface` property.
"""
return self._interface
@interface.setter
def interface(self, value):
"""
Sets the value of the `interface` property.
"""
Struct._check_type('interface', value, DiskInterface)
self._interface = value
@property
def read_only(self):
"""
Returns the value of the `read_only` property.
"""
return self._read_only
@read_only.setter
def read_only(self, value):
"""
Sets the value of the `read_only` property.
"""
self._read_only = value
class DiskProfile(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
permissions=None,
qos=None,
storage_domain=None,
):
super(DiskProfile, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.permissions = permissions
self.qos = qos
self.storage_domain = storage_domain
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def qos(self):
"""
Returns the value of the `qos` property.
"""
return self._qos
@qos.setter
def qos(self, value):
"""
Sets the value of the `qos` property.
"""
Struct._check_type('qos', value, Qos)
self._qos = value
class DiskSnapshot(Disk):
def __init__(
self,
active=None,
actual_size=None,
alias=None,
backup=None,
backup_mode=None,
bootable=None,
comment=None,
content_type=None,
description=None,
disk=None,
disk_profile=None,
disk_snapshots=None,
external_disk=None,
format=None,
id=None,
image_id=None,
initial_size=None,
instance_type=None,
interface=None,
logical_name=None,
lun_storage=None,
name=None,
openstack_volume_type=None,
parent=None,
permissions=None,
propagate_errors=None,
provisioned_size=None,
qcow_version=None,
quota=None,
read_only=None,
sgio=None,
shareable=None,
snapshot=None,
sparse=None,
statistics=None,
status=None,
storage_domain=None,
storage_domains=None,
storage_type=None,
template=None,
total_size=None,
uses_scsi_reservation=None,
vm=None,
vms=None,
wipe_after_delete=None,
):
super(DiskSnapshot, self).__init__(
active=active,
actual_size=actual_size,
alias=alias,
backup=backup,
backup_mode=backup_mode,
bootable=bootable,
comment=comment,
content_type=content_type,
description=description,
disk_profile=disk_profile,
disk_snapshots=disk_snapshots,
external_disk=external_disk,
format=format,
id=id,
image_id=image_id,
initial_size=initial_size,
instance_type=instance_type,
interface=interface,
logical_name=logical_name,
lun_storage=lun_storage,
name=name,
openstack_volume_type=openstack_volume_type,
permissions=permissions,
propagate_errors=propagate_errors,
provisioned_size=provisioned_size,
qcow_version=qcow_version,
quota=quota,
read_only=read_only,
sgio=sgio,
shareable=shareable,
snapshot=snapshot,
sparse=sparse,
statistics=statistics,
status=status,
storage_domain=storage_domain,
storage_domains=storage_domains,
storage_type=storage_type,
template=template,
total_size=total_size,
uses_scsi_reservation=uses_scsi_reservation,
vm=vm,
vms=vms,
wipe_after_delete=wipe_after_delete,
)
self.disk = disk
self.parent = parent
@property
def parent(self):
"""
Returns the value of the `parent` property.
"""
return self._parent
@parent.setter
def parent(self, value):
"""
Sets the value of the `parent` property.
"""
Struct._check_type('parent', value, DiskSnapshot)
self._parent = value
@property
def disk(self):
"""
Returns the value of the `disk` property.
"""
return self._disk
@disk.setter
def disk(self, value):
"""
Sets the value of the `disk` property.
"""
Struct._check_type('disk', value, Disk)
self._disk = value
class Domain(Identified):
def __init__(
self,
comment=None,
description=None,
groups=None,
id=None,
name=None,
user=None,
users=None,
):
super(Domain, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.groups = groups
self.user = user
self.users = users
@property
def users(self):
"""
Returns the value of the `users` property.
"""
return self._users
@users.setter
def users(self, value):
"""
Sets the value of the `users` property.
"""
self._users = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def groups(self):
"""
Returns the value of the `groups` property.
"""
return self._groups
@groups.setter
def groups(self, value):
"""
Sets the value of the `groups` property.
"""
self._groups = value
class Event(Identified):
def __init__(
self,
cluster=None,
code=None,
comment=None,
correlation_id=None,
custom_data=None,
custom_id=None,
data_center=None,
description=None,
flood_rate=None,
host=None,
id=None,
index=None,
log_on_host=None,
name=None,
origin=None,
severity=None,
storage_domain=None,
template=None,
time=None,
user=None,
vm=None,
):
super(Event, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.cluster = cluster
self.code = code
self.correlation_id = correlation_id
self.custom_data = custom_data
self.custom_id = custom_id
self.data_center = data_center
self.flood_rate = flood_rate
self.host = host
self.index = index
self.log_on_host = log_on_host
self.origin = origin
self.severity = severity
self.storage_domain = storage_domain
self.template = template
self.time = time
self.user = user
self.vm = vm
@property
def severity(self):
"""
Returns the value of the `severity` property.
"""
return self._severity
@severity.setter
def severity(self, value):
"""
Sets the value of the `severity` property.
"""
Struct._check_type('severity', value, LogSeverity)
self._severity = value
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def code(self):
"""
Returns the value of the `code` property.
"""
return self._code
@code.setter
def code(self, value):
"""
Sets the value of the `code` property.
"""
self._code = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def origin(self):
"""
Returns the value of the `origin` property.
"""
return self._origin
@origin.setter
def origin(self, value):
"""
Sets the value of the `origin` property.
"""
self._origin = value
@property
def correlation_id(self):
"""
Returns the value of the `correlation_id` property.
"""
return self._correlation_id
@correlation_id.setter
def correlation_id(self, value):
"""
Sets the value of the `correlation_id` property.
"""
self._correlation_id = value
@property
def index(self):
"""
Returns the value of the `index` property.
"""
return self._index
@index.setter
def index(self, value):
"""
Sets the value of the `index` property.
"""
self._index = value
@property
def flood_rate(self):
"""
Returns the value of the `flood_rate` property.
"""
return self._flood_rate
@flood_rate.setter
def flood_rate(self, value):
"""
Sets the value of the `flood_rate` property.
"""
self._flood_rate = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def custom_id(self):
"""
Returns the value of the `custom_id` property.
"""
return self._custom_id
@custom_id.setter
def custom_id(self, value):
"""
Sets the value of the `custom_id` property.
"""
self._custom_id = value
@property
def custom_data(self):
"""
Returns the value of the `custom_data` property.
"""
return self._custom_data
@custom_data.setter
def custom_data(self, value):
"""
Sets the value of the `custom_data` property.
"""
self._custom_data = value
@property
def log_on_host(self):
"""
Returns the value of the `log_on_host` property.
"""
return self._log_on_host
@log_on_host.setter
def log_on_host(self, value):
"""
Sets the value of the `log_on_host` property.
"""
self._log_on_host = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def time(self):
"""
Returns the value of the `time` property.
"""
return self._time
@time.setter
def time(self, value):
"""
Sets the value of the `time` property.
"""
self._time = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
class EventSubscription(Identified):
def __init__(
self,
address=None,
comment=None,
description=None,
event=None,
id=None,
name=None,
notification_method=None,
user=None,
):
super(EventSubscription, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.address = address
self.event = event
self.notification_method = notification_method
self.user = user
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def notification_method(self):
"""
Returns the value of the `notification_method` property.
"""
return self._notification_method
@notification_method.setter
def notification_method(self, value):
"""
Sets the value of the `notification_method` property.
"""
Struct._check_type('notification_method', value, NotificationMethod)
self._notification_method = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
Struct._check_type('user', value, User)
self._user = value
@property
def event(self):
"""
Returns the value of the `event` property.
"""
return self._event
@event.setter
def event(self, value):
"""
Sets the value of the `event` property.
"""
Struct._check_type('event', value, NotifiableEvent)
self._event = value
class ExternalComputeResource(Identified):
def __init__(
self,
comment=None,
description=None,
external_host_provider=None,
id=None,
name=None,
provider=None,
url=None,
user=None,
):
super(ExternalComputeResource, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.external_host_provider = external_host_provider
self.provider = provider
self.url = url
self.user = user
@property
def external_host_provider(self):
"""
Returns the value of the `external_host_provider` property.
"""
return self._external_host_provider
@external_host_provider.setter
def external_host_provider(self, value):
"""
Sets the value of the `external_host_provider` property.
"""
Struct._check_type('external_host_provider', value, ExternalHostProvider)
self._external_host_provider = value
@property
def provider(self):
"""
Returns the value of the `provider` property.
"""
return self._provider
@provider.setter
def provider(self, value):
"""
Sets the value of the `provider` property.
"""
self._provider = value
@property
def user(self):
"""
Returns the value of the `user` property.
"""
return self._user
@user.setter
def user(self, value):
"""
Sets the value of the `user` property.
"""
self._user = value
@property
def url(self):
"""
Returns the value of the `url` property.
"""
return self._url
@url.setter
def url(self, value):
"""
Sets the value of the `url` property.
"""
self._url = value
class ExternalDiscoveredHost(Identified):
def __init__(
self,
comment=None,
description=None,
external_host_provider=None,
id=None,
ip=None,
last_report=None,
mac=None,
name=None,
subnet_name=None,
):
super(ExternalDiscoveredHost, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.external_host_provider = external_host_provider
self.ip = ip
self.last_report = last_report
self.mac = mac
self.subnet_name = subnet_name
@property
def subnet_name(self):
"""
Returns the value of the `subnet_name` property.
"""
return self._subnet_name
@subnet_name.setter
def subnet_name(self, value):
"""
Sets the value of the `subnet_name` property.
"""
self._subnet_name = value
@property
def external_host_provider(self):
"""
Returns the value of the `external_host_provider` property.
"""
return self._external_host_provider
@external_host_provider.setter
def external_host_provider(self, value):
"""
Sets the value of the `external_host_provider` property.
"""
Struct._check_type('external_host_provider', value, ExternalHostProvider)
self._external_host_provider = value
@property
def last_report(self):
"""
Returns the value of the `last_report` property.
"""
return self._last_report
@last_report.setter
def last_report(self, value):
"""
Sets the value of the `last_report` property.
"""
self._last_report = value
@property
def ip(self):
"""
Returns the value of the `ip` property.
"""
return self._ip
@ip.setter
def ip(self, value):
"""
Sets the value of the `ip` property.
"""
self._ip = value
@property
def mac(self):
"""
Returns the value of the `mac` property.
"""
return self._mac
@mac.setter
def mac(self, value):
"""
Sets the value of the `mac` property.
"""
self._mac = value
class ExternalHost(Identified):
def __init__(
self,
address=None,
comment=None,
description=None,
external_host_provider=None,
id=None,
name=None,
):
super(ExternalHost, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.address = address
self.external_host_provider = external_host_provider
@property
def external_host_provider(self):
"""
Returns the value of the `external_host_provider` property.
"""
return self._external_host_provider
@external_host_provider.setter
def external_host_provider(self, value):
"""
Sets the value of the `external_host_provider` property.
"""
Struct._check_type('external_host_provider', value, ExternalHostProvider)
self._external_host_provider = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
class ExternalHostGroup(Identified):
def __init__(
self,
architecture_name=None,
comment=None,
description=None,
domain_name=None,
external_host_provider=None,
id=None,
name=None,
operating_system_name=None,
subnet_name=None,
):
super(ExternalHostGroup, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.architecture_name = architecture_name
self.domain_name = domain_name
self.external_host_provider = external_host_provider
self.operating_system_name = operating_system_name
self.subnet_name = subnet_name
@property
def subnet_name(self):
"""
Returns the value of the `subnet_name` property.
"""
return self._subnet_name
@subnet_name.setter
def subnet_name(self, value):
"""
Sets the value of the `subnet_name` property.
"""
self._subnet_name = value
@property
def domain_name(self):
"""
Returns the value of the `domain_name` property.
"""
return self._domain_name
@domain_name.setter
def domain_name(self, value):
"""
Sets the value of the `domain_name` property.
"""
self._domain_name = value
@property
def external_host_provider(self):
"""
Returns the value of the `external_host_provider` property.
"""
return self._external_host_provider
@external_host_provider.setter
def external_host_provider(self, value):
"""
Sets the value of the `external_host_provider` property.
"""
Struct._check_type('external_host_provider', value, ExternalHostProvider)
self._external_host_provider = value
@property
def operating_system_name(self):
"""
Returns the value of the `operating_system_name` property.
"""
return self._operating_system_name
@operating_system_name.setter
def operating_system_name(self, value):
"""
Sets the value of the `operating_system_name` property.
"""
self._operating_system_name = value
@property
def architecture_name(self):
"""
Returns the value of the `architecture_name` property.
"""
return self._architecture_name
@architecture_name.setter
def architecture_name(self, value):
"""
Sets the value of the `architecture_name` property.
"""
self._architecture_name = value
class ExternalNetworkProviderConfiguration(Identified):
def __init__(
self,
comment=None,
description=None,
external_network_provider=None,
host=None,
id=None,
name=None,
):
super(ExternalNetworkProviderConfiguration, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.external_network_provider = external_network_provider
self.host = host
@property
def external_network_provider(self):
"""
Returns the value of the `external_network_provider` property.
"""
return self._external_network_provider
@external_network_provider.setter
def external_network_provider(self, value):
"""
Sets the value of the `external_network_provider` property.
"""
Struct._check_type('external_network_provider', value, ExternalProvider)
self._external_network_provider = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
class ExternalProvider(Identified):
def __init__(
self,
authentication_url=None,
comment=None,
description=None,
id=None,
name=None,
password=None,
properties=None,
requires_authentication=None,
url=None,
username=None,
):
super(ExternalProvider, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.authentication_url = authentication_url
self.password = password
self.properties = properties
self.requires_authentication = requires_authentication
self.url = url
self.username = username
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def requires_authentication(self):
"""
Returns the value of the `requires_authentication` property.
"""
return self._requires_authentication
@requires_authentication.setter
def requires_authentication(self, value):
"""
Sets the value of the `requires_authentication` property.
"""
self._requires_authentication = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def authentication_url(self):
"""
Returns the value of the `authentication_url` property.
"""
return self._authentication_url
@authentication_url.setter
def authentication_url(self, value):
"""
Sets the value of the `authentication_url` property.
"""
self._authentication_url = value
@property
def url(self):
"""
Returns the value of the `url` property.
"""
return self._url
@url.setter
def url(self, value):
"""
Sets the value of the `url` property.
"""
self._url = value
@property
def properties(self):
"""
Returns the value of the `properties` property.
"""
return self._properties
@properties.setter
def properties(self, value):
"""
Sets the value of the `properties` property.
"""
self._properties = value
class File(Identified):
def __init__(
self,
comment=None,
content=None,
description=None,
id=None,
name=None,
storage_domain=None,
type=None,
):
super(File, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.content = content
self.storage_domain = storage_domain
self.type = type
@property
def storage_domain(self):
"""
Returns the value of the `storage_domain` property.
"""
return self._storage_domain
@storage_domain.setter
def storage_domain(self, value):
"""
Sets the value of the `storage_domain` property.
"""
Struct._check_type('storage_domain', value, StorageDomain)
self._storage_domain = value
@property
def content(self):
"""
Returns the value of the `content` property.
"""
return self._content
@content.setter
def content(self, value):
"""
Sets the value of the `content` property.
"""
self._content = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
class Filter(Identified):
def __init__(
self,
comment=None,
description=None,
id=None,
name=None,
position=None,
scheduling_policy_unit=None,
):
super(Filter, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.position = position
self.scheduling_policy_unit = scheduling_policy_unit
@property
def scheduling_policy_unit(self):
"""
Returns the value of the `scheduling_policy_unit` property.
"""
return self._scheduling_policy_unit
@scheduling_policy_unit.setter
def scheduling_policy_unit(self, value):
"""
Sets the value of the `scheduling_policy_unit` property.
"""
Struct._check_type('scheduling_policy_unit', value, SchedulingPolicyUnit)
self._scheduling_policy_unit = value
@property
def position(self):
"""
Returns the value of the `position` property.
"""
return self._position
@position.setter
def position(self, value):
"""
Sets the value of the `position` property.
"""
self._position = value
class Floppy(Device):
def __init__(
self,
comment=None,
description=None,
file=None,
id=None,
instance_type=None,
name=None,
template=None,
vm=None,
vms=None,
):
super(Floppy, self).__init__(
comment=comment,
description=description,
id=id,
instance_type=instance_type,
name=name,
template=template,
vm=vm,
vms=vms,
)
self.file = file
@property
def file(self):
"""
Returns the value of the `file` property.
"""
return self._file
@file.setter
def file(self, value):
"""
Sets the value of the `file` property.
"""
Struct._check_type('file', value, File)
self._file = value
class GlusterBrickAdvancedDetails(Device):
def __init__(
self,
comment=None,
description=None,
device=None,
fs_name=None,
gluster_clients=None,
id=None,
instance_type=None,
memory_pools=None,
mnt_options=None,
name=None,
pid=None,
port=None,
template=None,
vm=None,
vms=None,
):
super(GlusterBrickAdvancedDetails, self).__init__(
comment=comment,
description=description,
id=id,
instance_type=instance_type,
name=name,
template=template,
vm=vm,
vms=vms,
)
self.device = device
self.fs_name = fs_name
self.gluster_clients = gluster_clients
self.memory_pools = memory_pools
self.mnt_options = mnt_options
self.pid = pid
self.port = port
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def memory_pools(self):
"""
Returns the value of the `memory_pools` property.
"""
return self._memory_pools
@memory_pools.setter
def memory_pools(self, value):
"""
Sets the value of the `memory_pools` property.
"""
self._memory_pools = value
@property
def mnt_options(self):
"""
Returns the value of the `mnt_options` property.
"""
return self._mnt_options
@mnt_options.setter
def mnt_options(self, value):
"""
Sets the value of the `mnt_options` property.
"""
self._mnt_options = value
@property
def fs_name(self):
"""
Returns the value of the `fs_name` property.
"""
return self._fs_name
@fs_name.setter
def fs_name(self, value):
"""
Sets the value of the `fs_name` property.
"""
self._fs_name = value
@property
def pid(self):
"""
Returns the value of the `pid` property.
"""
return self._pid
@pid.setter
def pid(self, value):
"""
Sets the value of the `pid` property.
"""
self._pid = value
@property
def gluster_clients(self):
"""
Returns the value of the `gluster_clients` property.
"""
return self._gluster_clients
@gluster_clients.setter
def gluster_clients(self, value):
"""
Sets the value of the `gluster_clients` property.
"""
self._gluster_clients = value
@property
def device(self):
"""
Returns the value of the `device` property.
"""
return self._device
@device.setter
def device(self, value):
"""
Sets the value of the `device` property.
"""
self._device = value
class GlusterHook(Identified):
def __init__(
self,
checksum=None,
cluster=None,
comment=None,
conflict_status=None,
conflicts=None,
content=None,
content_type=None,
description=None,
gluster_command=None,
id=None,
name=None,
server_hooks=None,
stage=None,
status=None,
):
super(GlusterHook, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.checksum = checksum
self.cluster = cluster
self.conflict_status = conflict_status
self.conflicts = conflicts
self.content = content
self.content_type = content_type
self.gluster_command = gluster_command
self.server_hooks = server_hooks
self.stage = stage
self.status = status
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def stage(self):
"""
Returns the value of the `stage` property.
"""
return self._stage
@stage.setter
def stage(self, value):
"""
Sets the value of the `stage` property.
"""
Struct._check_type('stage', value, HookStage)
self._stage = value
@property
def content_type(self):
"""
Returns the value of the `content_type` property.
"""
return self._content_type
@content_type.setter
def content_type(self, value):
"""
Sets the value of the `content_type` property.
"""
Struct._check_type('content_type', value, HookContentType)
self._content_type = value
@property
def conflict_status(self):
"""
Returns the value of the `conflict_status` property.
"""
return self._conflict_status
@conflict_status.setter
def conflict_status(self, value):
"""
Sets the value of the `conflict_status` property.
"""
self._conflict_status = value
@property
def conflicts(self):
"""
Returns the value of the `conflicts` property.
"""
return self._conflicts
@conflicts.setter
def conflicts(self, value):
"""
Sets the value of the `conflicts` property.
"""
self._conflicts = value
@property
def checksum(self):
"""
Returns the value of the `checksum` property.
"""
return self._checksum
@checksum.setter
def checksum(self, value):
"""
Sets the value of the `checksum` property.
"""
self._checksum = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, GlusterHookStatus)
self._status = value
@property
def gluster_command(self):
"""
Returns the value of the `gluster_command` property.
"""
return self._gluster_command
@gluster_command.setter
def gluster_command(self, value):
"""
Sets the value of the `gluster_command` property.
"""
self._gluster_command = value
@property
def content(self):
"""
Returns the value of the `content` property.
"""
return self._content
@content.setter
def content(self, value):
"""
Sets the value of the `content` property.
"""
self._content = value
@property
def server_hooks(self):
"""
Returns the value of the `server_hooks` property.
"""
return self._server_hooks
@server_hooks.setter
def server_hooks(self, value):
"""
Sets the value of the `server_hooks` property.
"""
self._server_hooks = value
class GlusterMemoryPool(Identified):
def __init__(
self,
alloc_count=None,
cold_count=None,
comment=None,
description=None,
hot_count=None,
id=None,
max_alloc=None,
max_stdalloc=None,
name=None,
padded_size=None,
pool_misses=None,
type=None,
):
super(GlusterMemoryPool, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.alloc_count = alloc_count
self.cold_count = cold_count
self.hot_count = hot_count
self.max_alloc = max_alloc
self.max_stdalloc = max_stdalloc
self.padded_size = padded_size
self.pool_misses = pool_misses
self.type = type
@property
def cold_count(self):
"""
Returns the value of the `cold_count` property.
"""
return self._cold_count
@cold_count.setter
def cold_count(self, value):
"""
Sets the value of the `cold_count` property.
"""
self._cold_count = value
@property
def pool_misses(self):
"""
Returns the value of the `pool_misses` property.
"""
return self._pool_misses
@pool_misses.setter
def pool_misses(self, value):
"""
Sets the value of the `pool_misses` property.
"""
self._pool_misses = value
@property
def padded_size(self):
"""
Returns the value of the `padded_size` property.
"""
return self._padded_size
@padded_size.setter
def padded_size(self, value):
"""
Sets the value of the `padded_size` property.
"""
self._padded_size = value
@property
def max_stdalloc(self):
"""
Returns the value of the `max_stdalloc` property.
"""
return self._max_stdalloc
@max_stdalloc.setter
def max_stdalloc(self, value):
"""
Sets the value of the `max_stdalloc` property.
"""
self._max_stdalloc = value
@property
def alloc_count(self):
"""
Returns the value of the `alloc_count` property.
"""
return self._alloc_count
@alloc_count.setter
def alloc_count(self, value):
"""
Sets the value of the `alloc_count` property.
"""
self._alloc_count = value
@property
def hot_count(self):
"""
Returns the value of the `hot_count` property.
"""
return self._hot_count
@hot_count.setter
def hot_count(self, value):
"""
Sets the value of the `hot_count` property.
"""
self._hot_count = value
@property
def max_alloc(self):
"""
Returns the value of the `max_alloc` property.
"""
return self._max_alloc
@max_alloc.setter
def max_alloc(self, value):
"""
Sets the value of the `max_alloc` property.
"""
self._max_alloc = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
self._type = value
class GlusterServerHook(Identified):
def __init__(
self,
checksum=None,
comment=None,
content_type=None,
description=None,
host=None,
id=None,
name=None,
status=None,
):
super(GlusterServerHook, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.checksum = checksum
self.content_type = content_type
self.host = host
self.status = status
@property
def content_type(self):
"""
Returns the value of the `content_type` property.
"""
return self._content_type
@content_type.setter
def content_type(self, value):
"""
Sets the value of the `content_type` property.
"""
Struct._check_type('content_type', value, HookContentType)
self._content_type = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def checksum(self):
"""
Returns the value of the `checksum` property.
"""
return self._checksum
@checksum.setter
def checksum(self, value):
"""
Sets the value of the `checksum` property.
"""
self._checksum = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, GlusterHookStatus)
self._status = value
class GlusterVolume(Identified):
def __init__(
self,
bricks=None,
cluster=None,
comment=None,
description=None,
disperse_count=None,
id=None,
name=None,
options=None,
redundancy_count=None,
replica_count=None,
statistics=None,
status=None,
stripe_count=None,
transport_types=None,
volume_type=None,
):
super(GlusterVolume, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.bricks = bricks
self.cluster = cluster
self.disperse_count = disperse_count
self.options = options
self.redundancy_count = redundancy_count
self.replica_count = replica_count
self.statistics = statistics
self.status = status
self.stripe_count = stripe_count
self.transport_types = transport_types
self.volume_type = volume_type
@property
def disperse_count(self):
"""
Returns the value of the `disperse_count` property.
"""
return self._disperse_count
@disperse_count.setter
def disperse_count(self, value):
"""
Sets the value of the `disperse_count` property.
"""
self._disperse_count = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def bricks(self):
"""
Returns the value of the `bricks` property.
"""
return self._bricks
@bricks.setter
def bricks(self, value):
"""
Sets the value of the `bricks` property.
"""
self._bricks = value
@property
def transport_types(self):
"""
Returns the value of the `transport_types` property.
"""
return self._transport_types
@transport_types.setter
def transport_types(self, value):
"""
Sets the value of the `transport_types` property.
"""
self._transport_types = value
@property
def volume_type(self):
"""
Returns the value of the `volume_type` property.
"""
return self._volume_type
@volume_type.setter
def volume_type(self, value):
"""
Sets the value of the `volume_type` property.
"""
Struct._check_type('volume_type', value, GlusterVolumeType)
self._volume_type = value
@property
def redundancy_count(self):
"""
Returns the value of the `redundancy_count` property.
"""
return self._redundancy_count
@redundancy_count.setter
def redundancy_count(self, value):
"""
Sets the value of the `redundancy_count` property.
"""
self._redundancy_count = value
@property
def options(self):
"""
Returns the value of the `options` property.
"""
return self._options
@options.setter
def options(self, value):
"""
Sets the value of the `options` property.
"""
self._options = value
@property
def replica_count(self):
"""
Returns the value of the `replica_count` property.
"""
return self._replica_count
@replica_count.setter
def replica_count(self, value):
"""
Sets the value of the `replica_count` property.
"""
self._replica_count = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, GlusterVolumeStatus)
self._status = value
@property
def stripe_count(self):
"""
Returns the value of the `stripe_count` property.
"""
return self._stripe_count
@stripe_count.setter
def stripe_count(self, value):
"""
Sets the value of the `stripe_count` property.
"""
self._stripe_count = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
class GlusterVolumeProfileDetails(Identified):
def __init__(
self,
brick_profile_details=None,
comment=None,
description=None,
id=None,
name=None,
nfs_profile_details=None,
):
super(GlusterVolumeProfileDetails, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.brick_profile_details = brick_profile_details
self.nfs_profile_details = nfs_profile_details
@property
def brick_profile_details(self):
"""
Returns the value of the `brick_profile_details` property.
"""
return self._brick_profile_details
@brick_profile_details.setter
def brick_profile_details(self, value):
"""
Sets the value of the `brick_profile_details` property.
"""
self._brick_profile_details = value
@property
def nfs_profile_details(self):
"""
Returns the value of the `nfs_profile_details` property.
"""
return self._nfs_profile_details
@nfs_profile_details.setter
def nfs_profile_details(self, value):
"""
Sets the value of the `nfs_profile_details` property.
"""
self._nfs_profile_details = value
class GraphicsConsole(Identified):
def __init__(
self,
address=None,
comment=None,
description=None,
id=None,
instance_type=None,
name=None,
port=None,
protocol=None,
template=None,
tls_port=None,
vm=None,
):
super(GraphicsConsole, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.address = address
self.instance_type = instance_type
self.port = port
self.protocol = protocol
self.template = template
self.tls_port = tls_port
self.vm = vm
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def instance_type(self):
"""
Returns the value of the `instance_type` property.
"""
return self._instance_type
@instance_type.setter
def instance_type(self, value):
"""
Sets the value of the `instance_type` property.
"""
Struct._check_type('instance_type', value, InstanceType)
self._instance_type = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def protocol(self):
"""
Returns the value of the `protocol` property.
"""
return self._protocol
@protocol.setter
def protocol(self, value):
"""
Sets the value of the `protocol` property.
"""
Struct._check_type('protocol', value, GraphicsType)
self._protocol = value
@property
def tls_port(self):
"""
Returns the value of the `tls_port` property.
"""
return self._tls_port
@tls_port.setter
def tls_port(self, value):
"""
Sets the value of the `tls_port` property.
"""
self._tls_port = value
class Group(Identified):
def __init__(
self,
comment=None,
description=None,
domain=None,
domain_entry_id=None,
id=None,
name=None,
namespace=None,
permissions=None,
roles=None,
tags=None,
):
super(Group, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.domain = domain
self.domain_entry_id = domain_entry_id
self.namespace = namespace
self.permissions = permissions
self.roles = roles
self.tags = tags
@property
def domain(self):
"""
Returns the value of the `domain` property.
"""
return self._domain
@domain.setter
def domain(self, value):
"""
Sets the value of the `domain` property.
"""
Struct._check_type('domain', value, Domain)
self._domain = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def roles(self):
"""
Returns the value of the `roles` property.
"""
return self._roles
@roles.setter
def roles(self, value):
"""
Sets the value of the `roles` property.
"""
self._roles = value
@property
def namespace(self):
"""
Returns the value of the `namespace` property.
"""
return self._namespace
@namespace.setter
def namespace(self, value):
"""
Sets the value of the `namespace` property.
"""
self._namespace = value
@property
def domain_entry_id(self):
"""
Returns the value of the `domain_entry_id` property.
"""
return self._domain_entry_id
@domain_entry_id.setter
def domain_entry_id(self, value):
"""
Sets the value of the `domain_entry_id` property.
"""
self._domain_entry_id = value
@property
def tags(self):
"""
Returns the value of the `tags` property.
"""
return self._tags
@tags.setter
def tags(self, value):
"""
Sets the value of the `tags` property.
"""
self._tags = value
class Hook(Identified):
def __init__(
self,
comment=None,
description=None,
event_name=None,
host=None,
id=None,
md5=None,
name=None,
):
super(Hook, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.event_name = event_name
self.host = host
self.md5 = md5
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def event_name(self):
"""
Returns the value of the `event_name` property.
"""
return self._event_name
@event_name.setter
def event_name(self, value):
"""
Sets the value of the `event_name` property.
"""
self._event_name = value
@property
def md5(self):
"""
Returns the value of the `md5` property.
"""
return self._md5
@md5.setter
def md5(self, value):
"""
Sets the value of the `md5` property.
"""
self._md5 = value
class Host(Identified):
def __init__(
self,
address=None,
affinity_labels=None,
agents=None,
auto_numa_status=None,
certificate=None,
cluster=None,
comment=None,
cpu=None,
cpu_units=None,
description=None,
device_passthrough=None,
devices=None,
display=None,
external_host_provider=None,
external_network_provider_configurations=None,
external_status=None,
hardware_information=None,
hooks=None,
hosted_engine=None,
id=None,
iscsi=None,
katello_errata=None,
kdump_status=None,
ksm=None,
libvirt_version=None,
max_scheduling_memory=None,
memory=None,
name=None,
network_attachments=None,
network_operation_in_progress=None,
nics=None,
numa_nodes=None,
numa_supported=None,
os=None,
override_iptables=None,
ovn_configured=None,
permissions=None,
port=None,
power_management=None,
protocol=None,
reinstallation_required=None,
root_password=None,
se_linux=None,
spm=None,
ssh=None,
statistics=None,
status=None,
status_detail=None,
storage_connection_extensions=None,
storages=None,
summary=None,
tags=None,
transparent_huge_pages=None,
type=None,
unmanaged_networks=None,
update_available=None,
version=None,
vgpu_placement=None,
):
super(Host, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.address = address
self.affinity_labels = affinity_labels
self.agents = agents
self.auto_numa_status = auto_numa_status
self.certificate = certificate
self.cluster = cluster
self.cpu = cpu
self.cpu_units = cpu_units
self.device_passthrough = device_passthrough
self.devices = devices
self.display = display
self.external_host_provider = external_host_provider
self.external_network_provider_configurations = external_network_provider_configurations
self.external_status = external_status
self.hardware_information = hardware_information
self.hooks = hooks
self.hosted_engine = hosted_engine
self.iscsi = iscsi
self.katello_errata = katello_errata
self.kdump_status = kdump_status
self.ksm = ksm
self.libvirt_version = libvirt_version
self.max_scheduling_memory = max_scheduling_memory
self.memory = memory
self.network_attachments = network_attachments
self.network_operation_in_progress = network_operation_in_progress
self.nics = nics
self.numa_nodes = numa_nodes
self.numa_supported = numa_supported
self.os = os
self.override_iptables = override_iptables
self.ovn_configured = ovn_configured
self.permissions = permissions
self.port = port
self.power_management = power_management
self.protocol = protocol
self.reinstallation_required = reinstallation_required
self.root_password = root_password
self.se_linux = se_linux
self.spm = spm
self.ssh = ssh
self.statistics = statistics
self.status = status
self.status_detail = status_detail
self.storage_connection_extensions = storage_connection_extensions
self.storages = storages
self.summary = summary
self.tags = tags
self.transparent_huge_pages = transparent_huge_pages
self.type = type
self.unmanaged_networks = unmanaged_networks
self.update_available = update_available
self.version = version
self.vgpu_placement = vgpu_placement
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, Version)
self._version = value
@property
def summary(self):
"""
Returns the value of the `summary` property.
"""
return self._summary
@summary.setter
def summary(self, value):
"""
Sets the value of the `summary` property.
"""
Struct._check_type('summary', value, VmSummary)
self._summary = value
@property
def os(self):
"""
Returns the value of the `os` property.
"""
return self._os
@os.setter
def os(self, value):
"""
Sets the value of the `os` property.
"""
Struct._check_type('os', value, OperatingSystem)
self._os = value
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def devices(self):
"""
Returns the value of the `devices` property.
"""
return self._devices
@devices.setter
def devices(self, value):
"""
Sets the value of the `devices` property.
"""
self._devices = value
@property
def se_linux(self):
"""
Returns the value of the `se_linux` property.
"""
return self._se_linux
@se_linux.setter
def se_linux(self, value):
"""
Sets the value of the `se_linux` property.
"""
Struct._check_type('se_linux', value, SeLinux)
self._se_linux = value
@property
def affinity_labels(self):
"""
Returns the value of the `affinity_labels` property.
"""
return self._affinity_labels
@affinity_labels.setter
def affinity_labels(self, value):
"""
Sets the value of the `affinity_labels` property.
"""
self._affinity_labels = value
@property
def hosted_engine(self):
"""
Returns the value of the `hosted_engine` property.
"""
return self._hosted_engine
@hosted_engine.setter
def hosted_engine(self, value):
"""
Sets the value of the `hosted_engine` property.
"""
Struct._check_type('hosted_engine', value, HostedEngine)
self._hosted_engine = value
@property
def storage_connection_extensions(self):
"""
Returns the value of the `storage_connection_extensions` property.
"""
return self._storage_connection_extensions
@storage_connection_extensions.setter
def storage_connection_extensions(self, value):
"""
Sets the value of the `storage_connection_extensions` property.
"""
self._storage_connection_extensions = value
@property
def tags(self):
"""
Returns the value of the `tags` property.
"""
return self._tags
@tags.setter
def tags(self, value):
"""
Sets the value of the `tags` property.
"""
self._tags = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def reinstallation_required(self):
"""
Returns the value of the `reinstallation_required` property.
"""
return self._reinstallation_required
@reinstallation_required.setter
def reinstallation_required(self, value):
"""
Sets the value of the `reinstallation_required` property.
"""
self._reinstallation_required = value
@property
def override_iptables(self):
"""
Returns the value of the `override_iptables` property.
"""
return self._override_iptables
@override_iptables.setter
def override_iptables(self, value):
"""
Sets the value of the `override_iptables` property.
"""
self._override_iptables = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
@property
def numa_supported(self):
"""
Returns the value of the `numa_supported` property.
"""
return self._numa_supported
@numa_supported.setter
def numa_supported(self, value):
"""
Sets the value of the `numa_supported` property.
"""
self._numa_supported = value
@property
def hooks(self):
"""
Returns the value of the `hooks` property.
"""
return self._hooks
@hooks.setter
def hooks(self, value):
"""
Sets the value of the `hooks` property.
"""
self._hooks = value
@property
def ksm(self):
"""
Returns the value of the `ksm` property.
"""
return self._ksm
@ksm.setter
def ksm(self, value):
"""
Sets the value of the `ksm` property.
"""
Struct._check_type('ksm', value, Ksm)
self._ksm = value
@property
def ssh(self):
"""
Returns the value of the `ssh` property.
"""
return self._ssh
@ssh.setter
def ssh(self, value):
"""
Sets the value of the `ssh` property.
"""
Struct._check_type('ssh', value, Ssh)
self._ssh = value
@property
def kdump_status(self):
"""
Returns the value of the `kdump_status` property.
"""
return self._kdump_status
@kdump_status.setter
def kdump_status(self, value):
"""
Sets the value of the `kdump_status` property.
"""
Struct._check_type('kdump_status', value, KdumpStatus)
self._kdump_status = value
@property
def update_available(self):
"""
Returns the value of the `update_available` property.
"""
return self._update_available
@update_available.setter
def update_available(self, value):
"""
Sets the value of the `update_available` property.
"""
self._update_available = value
@property
def ovn_configured(self):
"""
Returns the value of the `ovn_configured` property.
"""
return self._ovn_configured
@ovn_configured.setter
def ovn_configured(self, value):
"""
Sets the value of the `ovn_configured` property.
"""
self._ovn_configured = value
@property
def external_network_provider_configurations(self):
"""
Returns the value of the `external_network_provider_configurations` property.
"""
return self._external_network_provider_configurations
@external_network_provider_configurations.setter
def external_network_provider_configurations(self, value):
"""
Sets the value of the `external_network_provider_configurations` property.
"""
self._external_network_provider_configurations = value
@property
def storages(self):
"""
Returns the value of the `storages` property.
"""
return self._storages
@storages.setter
def storages(self, value):
"""
Sets the value of the `storages` property.
"""
self._storages = value
@property
def numa_nodes(self):
"""
Returns the value of the `numa_nodes` property.
"""
return self._numa_nodes
@numa_nodes.setter
def numa_nodes(self, value):
"""
Sets the value of the `numa_nodes` property.
"""
self._numa_nodes = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def status_detail(self):
"""
Returns the value of the `status_detail` property.
"""
return self._status_detail
@status_detail.setter
def status_detail(self, value):
"""
Sets the value of the `status_detail` property.
"""
self._status_detail = value
@property
def power_management(self):
"""
Returns the value of the `power_management` property.
"""
return self._power_management
@power_management.setter
def power_management(self, value):
"""
Sets the value of the `power_management` property.
"""
Struct._check_type('power_management', value, PowerManagement)
self._power_management = value
@property
def nics(self):
"""
Returns the value of the `nics` property.
"""
return self._nics
@nics.setter
def nics(self, value):
"""
Sets the value of the `nics` property.
"""
self._nics = value
@property
def device_passthrough(self):
"""
Returns the value of the `device_passthrough` property.
"""
return self._device_passthrough
@device_passthrough.setter
def device_passthrough(self, value):
"""
Sets the value of the `device_passthrough` property.
"""
Struct._check_type('device_passthrough', value, HostDevicePassthrough)
self._device_passthrough = value
@property
def unmanaged_networks(self):
"""
Returns the value of the `unmanaged_networks` property.
"""
return self._unmanaged_networks
@unmanaged_networks.setter
def unmanaged_networks(self, value):
"""
Sets the value of the `unmanaged_networks` property.
"""
self._unmanaged_networks = value
@property
def protocol(self):
"""
Returns the value of the `protocol` property.
"""
return self._protocol
@protocol.setter
def protocol(self, value):
"""
Sets the value of the `protocol` property.
"""
Struct._check_type('protocol', value, HostProtocol)
self._protocol = value
@property
def root_password(self):
"""
Returns the value of the `root_password` property.
"""
return self._root_password
@root_password.setter
def root_password(self, value):
"""
Sets the value of the `root_password` property.
"""
self._root_password = value
@property
def network_attachments(self):
"""
Returns the value of the `network_attachments` property.
"""
return self._network_attachments
@network_attachments.setter
def network_attachments(self, value):
"""
Sets the value of the `network_attachments` property.
"""
self._network_attachments = value
@property
def max_scheduling_memory(self):
"""
Returns the value of the `max_scheduling_memory` property.
"""
return self._max_scheduling_memory
@max_scheduling_memory.setter
def max_scheduling_memory(self, value):
"""
Sets the value of the `max_scheduling_memory` property.
"""
self._max_scheduling_memory = value
@property
def display(self):
"""
Returns the value of the `display` property.
"""
return self._display
@display.setter
def display(self, value):
"""
Sets the value of the `display` property.
"""
Struct._check_type('display', value, Display)
self._display = value
@property
def auto_numa_status(self):
"""
Returns the value of the `auto_numa_status` property.
"""
return self._auto_numa_status
@auto_numa_status.setter
def auto_numa_status(self, value):
"""
Sets the value of the `auto_numa_status` property.
"""
Struct._check_type('auto_numa_status', value, AutoNumaStatus)
self._auto_numa_status = value
@property
def cpu(self):
"""
Returns the value of the `cpu` property.
"""
return self._cpu
@cpu.setter
def cpu(self, value):
"""
Sets the value of the `cpu` property.
"""
Struct._check_type('cpu', value, Cpu)
self._cpu = value
@property
def external_status(self):
"""
Returns the value of the `external_status` property.
"""
return self._external_status
@external_status.setter
def external_status(self, value):
"""
Sets the value of the `external_status` property.
"""
Struct._check_type('external_status', value, ExternalStatus)
self._external_status = value
@property
def agents(self):
"""
Returns the value of the `agents` property.
"""
return self._agents
@agents.setter
def agents(self, value):
"""
Sets the value of the `agents` property.
"""
self._agents = value
@property
def spm(self):
"""
Returns the value of the `spm` property.
"""
return self._spm
@spm.setter
def spm(self, value):
"""
Sets the value of the `spm` property.
"""
Struct._check_type('spm', value, Spm)
self._spm = value
@property
def libvirt_version(self):
"""
Returns the value of the `libvirt_version` property.
"""
return self._libvirt_version
@libvirt_version.setter
def libvirt_version(self, value):
"""
Sets the value of the `libvirt_version` property.
"""
Struct._check_type('libvirt_version', value, Version)
self._libvirt_version = value
@property
def iscsi(self):
"""
Returns the value of the `iscsi` property.
"""
return self._iscsi
@iscsi.setter
def iscsi(self, value):
"""
Sets the value of the `iscsi` property.
"""
Struct._check_type('iscsi', value, IscsiDetails)
self._iscsi = value
@property
def cpu_units(self):
"""
Returns the value of the `cpu_units` property.
"""
return self._cpu_units
@cpu_units.setter
def cpu_units(self, value):
"""
Sets the value of the `cpu_units` property.
"""
self._cpu_units = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, HostStatus)
self._status = value
@property
def hardware_information(self):
"""
Returns the value of the `hardware_information` property.
"""
return self._hardware_information
@hardware_information.setter
def hardware_information(self, value):
"""
Sets the value of the `hardware_information` property.
"""
Struct._check_type('hardware_information', value, HardwareInformation)
self._hardware_information = value
@property
def katello_errata(self):
"""
Returns the value of the `katello_errata` property.
"""
return self._katello_errata
@katello_errata.setter
def katello_errata(self, value):
"""
Sets the value of the `katello_errata` property.
"""
self._katello_errata = value
@property
def memory(self):
"""
Returns the value of the `memory` property.
"""
return self._memory
@memory.setter
def memory(self, value):
"""
Sets the value of the `memory` property.
"""
self._memory = value
@property
def cluster(self):
"""
Returns the value of the `cluster` property.
"""
return self._cluster
@cluster.setter
def cluster(self, value):
"""
Sets the value of the `cluster` property.
"""
Struct._check_type('cluster', value, Cluster)
self._cluster = value
@property
def transparent_huge_pages(self):
"""
Returns the value of the `transparent_huge_pages` property.
"""
return self._transparent_huge_pages
@transparent_huge_pages.setter
def transparent_huge_pages(self, value):
"""
Sets the value of the `transparent_huge_pages` property.
"""
Struct._check_type('transparent_huge_pages', value, TransparentHugePages)
self._transparent_huge_pages = value
@property
def certificate(self):
"""
Returns the value of the `certificate` property.
"""
return self._certificate
@certificate.setter
def certificate(self, value):
"""
Sets the value of the `certificate` property.
"""
Struct._check_type('certificate', value, Certificate)
self._certificate = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, HostType)
self._type = value
@property
def external_host_provider(self):
"""
Returns the value of the `external_host_provider` property.
"""
return self._external_host_provider
@external_host_provider.setter
def external_host_provider(self, value):
"""
Sets the value of the `external_host_provider` property.
"""
Struct._check_type('external_host_provider', value, ExternalHostProvider)
self._external_host_provider = value
@property
def vgpu_placement(self):
"""
Returns the value of the `vgpu_placement` property.
"""
return self._vgpu_placement
@vgpu_placement.setter
def vgpu_placement(self, value):
"""
Sets the value of the `vgpu_placement` property.
"""
Struct._check_type('vgpu_placement', value, VgpuPlacement)
self._vgpu_placement = value
@property
def network_operation_in_progress(self):
"""
Returns the value of the `network_operation_in_progress` property.
"""
return self._network_operation_in_progress
@network_operation_in_progress.setter
def network_operation_in_progress(self, value):
"""
Sets the value of the `network_operation_in_progress` property.
"""
self._network_operation_in_progress = value
class HostCpuUnit(Identified):
def __init__(
self,
comment=None,
core_id=None,
cpu_id=None,
description=None,
id=None,
name=None,
runs_vdsm=None,
socket_id=None,
vms=None,
):
super(HostCpuUnit, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.core_id = core_id
self.cpu_id = cpu_id
self.runs_vdsm = runs_vdsm
self.socket_id = socket_id
self.vms = vms
@property
def socket_id(self):
"""
Returns the value of the `socket_id` property.
"""
return self._socket_id
@socket_id.setter
def socket_id(self, value):
"""
Sets the value of the `socket_id` property.
"""
self._socket_id = value
@property
def runs_vdsm(self):
"""
Returns the value of the `runs_vdsm` property.
"""
return self._runs_vdsm
@runs_vdsm.setter
def runs_vdsm(self, value):
"""
Sets the value of the `runs_vdsm` property.
"""
self._runs_vdsm = value
@property
def core_id(self):
"""
Returns the value of the `core_id` property.
"""
return self._core_id
@core_id.setter
def core_id(self, value):
"""
Sets the value of the `core_id` property.
"""
self._core_id = value
@property
def cpu_id(self):
"""
Returns the value of the `cpu_id` property.
"""
return self._cpu_id
@cpu_id.setter
def cpu_id(self, value):
"""
Sets the value of the `cpu_id` property.
"""
self._cpu_id = value
@property
def vms(self):
"""
Returns the value of the `vms` property.
"""
return self._vms
@vms.setter
def vms(self, value):
"""
Sets the value of the `vms` property.
"""
self._vms = value
class HostDevice(Identified):
def __init__(
self,
capability=None,
comment=None,
description=None,
driver=None,
host=None,
id=None,
iommu_group=None,
m_dev_types=None,
name=None,
parent_device=None,
physical_function=None,
placeholder=None,
product=None,
vendor=None,
virtual_functions=None,
vm=None,
):
super(HostDevice, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.capability = capability
self.driver = driver
self.host = host
self.iommu_group = iommu_group
self.m_dev_types = m_dev_types
self.parent_device = parent_device
self.physical_function = physical_function
self.placeholder = placeholder
self.product = product
self.vendor = vendor
self.virtual_functions = virtual_functions
self.vm = vm
@property
def product(self):
"""
Returns the value of the `product` property.
"""
return self._product
@product.setter
def product(self, value):
"""
Sets the value of the `product` property.
"""
Struct._check_type('product', value, Product)
self._product = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def virtual_functions(self):
"""
Returns the value of the `virtual_functions` property.
"""
return self._virtual_functions
@virtual_functions.setter
def virtual_functions(self, value):
"""
Sets the value of the `virtual_functions` property.
"""
self._virtual_functions = value
@property
def vendor(self):
"""
Returns the value of the `vendor` property.
"""
return self._vendor
@vendor.setter
def vendor(self, value):
"""
Sets the value of the `vendor` property.
"""
Struct._check_type('vendor', value, Vendor)
self._vendor = value
@property
def placeholder(self):
"""
Returns the value of the `placeholder` property.
"""
return self._placeholder
@placeholder.setter
def placeholder(self, value):
"""
Sets the value of the `placeholder` property.
"""
self._placeholder = value
@property
def driver(self):
"""
Returns the value of the `driver` property.
"""
return self._driver
@driver.setter
def driver(self, value):
"""
Sets the value of the `driver` property.
"""
self._driver = value
@property
def iommu_group(self):
"""
Returns the value of the `iommu_group` property.
"""
return self._iommu_group
@iommu_group.setter
def iommu_group(self, value):
"""
Sets the value of the `iommu_group` property.
"""
self._iommu_group = value
@property
def m_dev_types(self):
"""
Returns the value of the `m_dev_types` property.
"""
return self._m_dev_types
@m_dev_types.setter
def m_dev_types(self, value):
"""
Sets the value of the `m_dev_types` property.
"""
self._m_dev_types = value
@property
def parent_device(self):
"""
Returns the value of the `parent_device` property.
"""
return self._parent_device
@parent_device.setter
def parent_device(self, value):
"""
Sets the value of the `parent_device` property.
"""
Struct._check_type('parent_device', value, HostDevice)
self._parent_device = value
@property
def capability(self):
"""
Returns the value of the `capability` property.
"""
return self._capability
@capability.setter
def capability(self, value):
"""
Sets the value of the `capability` property.
"""
self._capability = value
@property
def physical_function(self):
"""
Returns the value of the `physical_function` property.
"""
return self._physical_function
@physical_function.setter
def physical_function(self, value):
"""
Sets the value of the `physical_function` property.
"""
Struct._check_type('physical_function', value, HostDevice)
self._physical_function = value
class HostNic(Identified):
def __init__(
self,
ad_aggregator_id=None,
base_interface=None,
bonding=None,
boot_protocol=None,
bridged=None,
check_connectivity=None,
comment=None,
custom_configuration=None,
description=None,
host=None,
id=None,
ip=None,
ipv6=None,
ipv6_boot_protocol=None,
mac=None,
mtu=None,
name=None,
network=None,
network_labels=None,
override_configuration=None,
physical_function=None,
properties=None,
qos=None,
speed=None,
statistics=None,
status=None,
virtual_functions_configuration=None,
vlan=None,
):
super(HostNic, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.ad_aggregator_id = ad_aggregator_id
self.base_interface = base_interface
self.bonding = bonding
self.boot_protocol = boot_protocol
self.bridged = bridged
self.check_connectivity = check_connectivity
self.custom_configuration = custom_configuration
self.host = host
self.ip = ip
self.ipv6 = ipv6
self.ipv6_boot_protocol = ipv6_boot_protocol
self.mac = mac
self.mtu = mtu
self.network = network
self.network_labels = network_labels
self.override_configuration = override_configuration
self.physical_function = physical_function
self.properties = properties
self.qos = qos
self.speed = speed
self.statistics = statistics
self.status = status
self.virtual_functions_configuration = virtual_functions_configuration
self.vlan = vlan
@property
def base_interface(self):
"""
Returns the value of the `base_interface` property.
"""
return self._base_interface
@base_interface.setter
def base_interface(self, value):
"""
Sets the value of the `base_interface` property.
"""
self._base_interface = value
@property
def ad_aggregator_id(self):
"""
Returns the value of the `ad_aggregator_id` property.
"""
return self._ad_aggregator_id
@ad_aggregator_id.setter
def ad_aggregator_id(self, value):
"""
Sets the value of the `ad_aggregator_id` property.
"""
self._ad_aggregator_id = value
@property
def boot_protocol(self):
"""
Returns the value of the `boot_protocol` property.
"""
return self._boot_protocol
@boot_protocol.setter
def boot_protocol(self, value):
"""
Sets the value of the `boot_protocol` property.
"""
Struct._check_type('boot_protocol', value, BootProtocol)
self._boot_protocol = value
@property
def ip(self):
"""
Returns the value of the `ip` property.
"""
return self._ip
@ip.setter
def ip(self, value):
"""
Sets the value of the `ip` property.
"""
Struct._check_type('ip', value, Ip)
self._ip = value
@property
def custom_configuration(self):
"""
Returns the value of the `custom_configuration` property.
"""
return self._custom_configuration
@custom_configuration.setter
def custom_configuration(self, value):
"""
Sets the value of the `custom_configuration` property.
"""
self._custom_configuration = value
@property
def network_labels(self):
"""
Returns the value of the `network_labels` property.
"""
return self._network_labels
@network_labels.setter
def network_labels(self, value):
"""
Sets the value of the `network_labels` property.
"""
self._network_labels = value
@property
def check_connectivity(self):
"""
Returns the value of the `check_connectivity` property.
"""
return self._check_connectivity
@check_connectivity.setter
def check_connectivity(self, value):
"""
Sets the value of the `check_connectivity` property.
"""
self._check_connectivity = value
@property
def mtu(self):
"""
Returns the value of the `mtu` property.
"""
return self._mtu
@mtu.setter
def mtu(self, value):
"""
Sets the value of the `mtu` property.
"""
self._mtu = value
@property
def network(self):
"""
Returns the value of the `network` property.
"""
return self._network
@network.setter
def network(self, value):
"""
Sets the value of the `network` property.
"""
Struct._check_type('network', value, Network)
self._network = value
@property
def mac(self):
"""
Returns the value of the `mac` property.
"""
return self._mac
@mac.setter
def mac(self, value):
"""
Sets the value of the `mac` property.
"""
Struct._check_type('mac', value, Mac)
self._mac = value
@property
def speed(self):
"""
Returns the value of the `speed` property.
"""
return self._speed
@speed.setter
def speed(self, value):
"""
Sets the value of the `speed` property.
"""
self._speed = value
@property
def override_configuration(self):
"""
Returns the value of the `override_configuration` property.
"""
return self._override_configuration
@override_configuration.setter
def override_configuration(self, value):
"""
Sets the value of the `override_configuration` property.
"""
self._override_configuration = value
@property
def vlan(self):
"""
Returns the value of the `vlan` property.
"""
return self._vlan
@vlan.setter
def vlan(self, value):
"""
Sets the value of the `vlan` property.
"""
Struct._check_type('vlan', value, Vlan)
self._vlan = value
@property
def qos(self):
"""
Returns the value of the `qos` property.
"""
return self._qos
@qos.setter
def qos(self, value):
"""
Sets the value of the `qos` property.
"""
Struct._check_type('qos', value, Qos)
self._qos = value
@property
def virtual_functions_configuration(self):
"""
Returns the value of the `virtual_functions_configuration` property.
"""
return self._virtual_functions_configuration
@virtual_functions_configuration.setter
def virtual_functions_configuration(self, value):
"""
Sets the value of the `virtual_functions_configuration` property.
"""
Struct._check_type('virtual_functions_configuration', value, HostNicVirtualFunctionsConfiguration)
self._virtual_functions_configuration = value
@property
def ipv6(self):
"""
Returns the value of the `ipv6` property.
"""
return self._ipv6
@ipv6.setter
def ipv6(self, value):
"""
Sets the value of the `ipv6` property.
"""
Struct._check_type('ipv6', value, Ip)
self._ipv6 = value
@property
def bonding(self):
"""
Returns the value of the `bonding` property.
"""
return self._bonding
@bonding.setter
def bonding(self, value):
"""
Sets the value of the `bonding` property.
"""
Struct._check_type('bonding', value, Bonding)
self._bonding = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def bridged(self):
"""
Returns the value of the `bridged` property.
"""
return self._bridged
@bridged.setter
def bridged(self, value):
"""
Sets the value of the `bridged` property.
"""
self._bridged = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, NicStatus)
self._status = value
@property
def ipv6_boot_protocol(self):
"""
Returns the value of the `ipv6_boot_protocol` property.
"""
return self._ipv6_boot_protocol
@ipv6_boot_protocol.setter
def ipv6_boot_protocol(self, value):
"""
Sets the value of the `ipv6_boot_protocol` property.
"""
Struct._check_type('ipv6_boot_protocol', value, BootProtocol)
self._ipv6_boot_protocol = value
@property
def physical_function(self):
"""
Returns the value of the `physical_function` property.
"""
return self._physical_function
@physical_function.setter
def physical_function(self, value):
"""
Sets the value of the `physical_function` property.
"""
Struct._check_type('physical_function', value, HostNic)
self._physical_function = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
@property
def properties(self):
"""
Returns the value of the `properties` property.
"""
return self._properties
@properties.setter
def properties(self, value):
"""
Sets the value of the `properties` property.
"""
self._properties = value
class HostStorage(Identified):
def __init__(
self,
address=None,
comment=None,
description=None,
driver_options=None,
driver_sensitive_options=None,
host=None,
id=None,
logical_units=None,
mount_options=None,
name=None,
nfs_retrans=None,
nfs_timeo=None,
nfs_version=None,
override_luns=None,
password=None,
path=None,
port=None,
portal=None,
target=None,
type=None,
username=None,
vfs_type=None,
volume_group=None,
):
super(HostStorage, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.address = address
self.driver_options = driver_options
self.driver_sensitive_options = driver_sensitive_options
self.host = host
self.logical_units = logical_units
self.mount_options = mount_options
self.nfs_retrans = nfs_retrans
self.nfs_timeo = nfs_timeo
self.nfs_version = nfs_version
self.override_luns = override_luns
self.password = password
self.path = path
self.port = port
self.portal = portal
self.target = target
self.type = type
self.username = username
self.vfs_type = vfs_type
self.volume_group = volume_group
@property
def address(self):
"""
Returns the value of the `address` property.
"""
return self._address
@address.setter
def address(self, value):
"""
Sets the value of the `address` property.
"""
self._address = value
@property
def driver_sensitive_options(self):
"""
Returns the value of the `driver_sensitive_options` property.
"""
return self._driver_sensitive_options
@driver_sensitive_options.setter
def driver_sensitive_options(self, value):
"""
Sets the value of the `driver_sensitive_options` property.
"""
self._driver_sensitive_options = value
@property
def driver_options(self):
"""
Returns the value of the `driver_options` property.
"""
return self._driver_options
@driver_options.setter
def driver_options(self, value):
"""
Sets the value of the `driver_options` property.
"""
self._driver_options = value
@property
def target(self):
"""
Returns the value of the `target` property.
"""
return self._target
@target.setter
def target(self, value):
"""
Sets the value of the `target` property.
"""
self._target = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, StorageType)
self._type = value
@property
def nfs_timeo(self):
"""
Returns the value of the `nfs_timeo` property.
"""
return self._nfs_timeo
@nfs_timeo.setter
def nfs_timeo(self, value):
"""
Sets the value of the `nfs_timeo` property.
"""
self._nfs_timeo = value
@property
def path(self):
"""
Returns the value of the `path` property.
"""
return self._path
@path.setter
def path(self, value):
"""
Sets the value of the `path` property.
"""
self._path = value
@property
def nfs_retrans(self):
"""
Returns the value of the `nfs_retrans` property.
"""
return self._nfs_retrans
@nfs_retrans.setter
def nfs_retrans(self, value):
"""
Sets the value of the `nfs_retrans` property.
"""
self._nfs_retrans = value
@property
def password(self):
"""
Returns the value of the `password` property.
"""
return self._password
@password.setter
def password(self, value):
"""
Sets the value of the `password` property.
"""
self._password = value
@property
def port(self):
"""
Returns the value of the `port` property.
"""
return self._port
@port.setter
def port(self, value):
"""
Sets the value of the `port` property.
"""
self._port = value
@property
def volume_group(self):
"""
Returns the value of the `volume_group` property.
"""
return self._volume_group
@volume_group.setter
def volume_group(self, value):
"""
Sets the value of the `volume_group` property.
"""
Struct._check_type('volume_group', value, VolumeGroup)
self._volume_group = value
@property
def vfs_type(self):
"""
Returns the value of the `vfs_type` property.
"""
return self._vfs_type
@vfs_type.setter
def vfs_type(self, value):
"""
Sets the value of the `vfs_type` property.
"""
self._vfs_type = value
@property
def nfs_version(self):
"""
Returns the value of the `nfs_version` property.
"""
return self._nfs_version
@nfs_version.setter
def nfs_version(self, value):
"""
Sets the value of the `nfs_version` property.
"""
Struct._check_type('nfs_version', value, NfsVersion)
self._nfs_version = value
@property
def logical_units(self):
"""
Returns the value of the `logical_units` property.
"""
return self._logical_units
@logical_units.setter
def logical_units(self, value):
"""
Sets the value of the `logical_units` property.
"""
self._logical_units = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def portal(self):
"""
Returns the value of the `portal` property.
"""
return self._portal
@portal.setter
def portal(self, value):
"""
Sets the value of the `portal` property.
"""
self._portal = value
@property
def username(self):
"""
Returns the value of the `username` property.
"""
return self._username
@username.setter
def username(self, value):
"""
Sets the value of the `username` property.
"""
self._username = value
@property
def override_luns(self):
"""
Returns the value of the `override_luns` property.
"""
return self._override_luns
@override_luns.setter
def override_luns(self, value):
"""
Sets the value of the `override_luns` property.
"""
self._override_luns = value
@property
def mount_options(self):
"""
Returns the value of the `mount_options` property.
"""
return self._mount_options
@mount_options.setter
def mount_options(self, value):
"""
Sets the value of the `mount_options` property.
"""
self._mount_options = value
class Icon(Identified):
def __init__(
self,
comment=None,
data=None,
description=None,
id=None,
media_type=None,
name=None,
):
super(Icon, self).__init__(
comment=comment,
description=description,
id=id,
name=name,
)
self.data = data
self.media_type = media_type
@property
def media_type(self):
"""
Returns the value of the `media_type` property.
"""
return self._media_type
@media_type.setter
def media_type(self, value):
"""
Sets the value of the `media_type` property.
"""
self._media_type = value
@property
def data(self):
"""
Returns the value of the `data` property.
"""
return self._data
@data.setter
def data(self, value):
"""
Sets the value of the `data` property.
"""
self._data = value
class Nic(Device):
def __init__(
self,
boot_protocol=None,
comment=None,
description=None,
id=None,
instance_type=None,
interface=None,
linked=None,
mac=None,
name=None,
network=None,
network_attachments=None,
network_filter_parameters=None,
network_labels=None,
on_boot=None,
plugged=None,
reported_devices=None,
statistics=None,
synced=None,
template=None,
virtual_function_allowed_labels=None,
virtual_function_allowed_networks=None,
vm=None,
vms=None,
vnic_profile=None,
):
super(Nic, self).__init__(
comment=comment,
description=description,
id=id,
instance_type=instance_type,
name=name,
template=template,
vm=vm,
vms=vms,
)
self.boot_protocol = boot_protocol
self.interface = interface
self.linked = linked
self.mac = mac
self.network = network
self.network_attachments = network_attachments
self.network_filter_parameters = network_filter_parameters
self.network_labels = network_labels
self.on_boot = on_boot
self.plugged = plugged
self.reported_devices = reported_devices
self.statistics = statistics
self.synced = synced
self.virtual_function_allowed_labels = virtual_function_allowed_labels
self.virtual_function_allowed_networks = virtual_function_allowed_networks
self.vnic_profile = vnic_profile
@property
def synced(self):
"""
Returns the value of the `synced` property.
"""
return self._synced
@synced.setter
def synced(self, value):
"""
Sets the value of the `synced` property.
"""
self._synced = value
@property
def reported_devices(self):
"""
Returns the value of the `reported_devices` property.
"""
return self._reported_devices
@reported_devices.setter
def reported_devices(self, value):
"""
Sets the value of the `reported_devices` property.
"""
self._reported_devices = value
@property
def virtual_function_allowed_labels(self):
"""
Returns the value of the `virtual_function_allowed_labels` property.
"""
return self._virtual_function_allowed_labels
@virtual_function_allowed_labels.setter
def virtual_function_allowed_labels(self, value):
"""
Sets the value of the `virtual_function_allowed_labels` property.
"""
self._virtual_function_allowed_labels = value
@property
def network_filter_parameters(self):
"""
Returns the value of the `network_filter_parameters` property.
"""
return self._network_filter_parameters
@network_filter_parameters.setter
def network_filter_parameters(self, value):
"""
Sets the value of the `network_filter_parameters` property.
"""
self._network_filter_parameters = value
@property
def boot_protocol(self):
"""
Returns the value of the `boot_protocol` property.
"""
return self._boot_protocol
@boot_protocol.setter
def boot_protocol(self, value):
"""
Sets the value of the `boot_protocol` property.
"""
Struct._check_type('boot_protocol', value, BootProtocol)
self._boot_protocol = value
@property
def network_labels(self):
"""
Returns the value of the `network_labels` property.
"""
return self._network_labels
@network_labels.setter
def network_labels(self, value):
"""
Sets the value of the `network_labels` property.
"""
self._network_labels = value
@property
def network(self):
"""
Returns the value of the `network` property.
"""
return self._network
@network.setter
def network(self, value):
"""
Sets the value of the `network` property.
"""
Struct._check_type('network', value, Network)
self._network = value
@property
def interface(self):
"""
Returns the value of the `interface` property.
"""
return self._interface
@interface.setter
def interface(self, value):
"""
Sets the value of the `interface` property.
"""
Struct._check_type('interface', value, NicInterface)
self._interface = value
@property
def mac(self):
"""
Returns the value of the `mac` property.
"""
return self._mac
@mac.setter
def mac(self, value):
"""
Sets the value of the `mac` property.
"""
Struct._check_type('mac', value, Mac)
self._mac = value
@property
def plugged(self):
"""
Returns the value of the `plugged` property.
"""
return self._plugged
@plugged.setter
def plugged(self, value):
"""
Sets the value of the `plugged` property.
"""
self._plugged = value
@property
def virtual_function_allowed_networks(self):
"""
Returns the value of the `virtual_function_allowed_networks` property.
"""
return self._virtual_function_allowed_networks
@virtual_function_allowed_networks.setter
def virtual_function_allowed_networks(self, value):
"""
Sets the value of the `virtual_function_allowed_networks` property.
"""
self._virtual_function_allowed_networks = value
@property
def vnic_profile(self):
"""
Returns the value of the `vnic_profile` property.
"""
return self._vnic_profile
@vnic_profile.setter
def vnic_profile(self, value):
"""
Sets the value of the `vnic_profile` property.
"""
Struct._check_type('vnic_profile', value, VnicProfile)
self._vnic_profile = value
@property
def on_boot(self):
"""
Returns the value of the `on_boot` property.
"""
return self._on_boot
@on_boot.setter
def on_boot(self, value):
"""
Sets the value of the `on_boot` property.
"""
self._on_boot = value
@property
def linked(self):
"""
Returns the value of the `linked` property.
"""
return self._linked
@linked.setter
def linked(self, value):
"""
Sets the value of the `linked` property.
"""
self._linked = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
@property
def network_attachments(self):
"""
Returns the value of the `network_attachments` property.
"""
return self._network_attachments
@network_attachments.setter
def network_attachments(self, value):
"""
Sets the value of the `network_attachments` property.
"""
self._network_attachments = value
class OpenStackProvider(ExternalProvider):
def __init__(
self,
authentication_url=None,
comment=None,
description=None,
id=None,
name=None,
password=None,
properties=None,
requires_authentication=None,
tenant_name=None,
url=None,
username=None,
):
super(OpenStackProvider, self).__init__(
authentication_url=authentication_url,
comment=comment,
description=description,
id=id,
name=name,
password=password,
properties=properties,
requires_authentication=requires_authentication,
url=url,
username=username,
)
self.tenant_name = tenant_name
@property
def tenant_name(self):
"""
Returns the value of the `tenant_name` property.
"""
return self._tenant_name
@tenant_name.setter
def tenant_name(self, value):
"""
Sets the value of the `tenant_name` property.
"""
self._tenant_name = value
class OpenStackVolumeProvider(OpenStackProvider):
def __init__(
self,
authentication_keys=None,
authentication_url=None,
certificates=None,
comment=None,
data_center=None,
description=None,
id=None,
name=None,
password=None,
properties=None,
requires_authentication=None,
tenant_name=None,
url=None,
username=None,
volume_types=None,
):
super(OpenStackVolumeProvider, self).__init__(
authentication_url=authentication_url,
comment=comment,
description=description,
id=id,
name=name,
password=password,
properties=properties,
requires_authentication=requires_authentication,
tenant_name=tenant_name,
url=url,
username=username,
)
self.authentication_keys = authentication_keys
self.certificates = certificates
self.data_center = data_center
self.volume_types = volume_types
@property
def certificates(self):
"""
Returns the value of the `certificates` property.
"""
return self._certificates
@certificates.setter
def certificates(self, value):
"""
Sets the value of the `certificates` property.
"""
self._certificates = value
@property
def authentication_keys(self):
"""
Returns the value of the `authentication_keys` property.
"""
return self._authentication_keys
@authentication_keys.setter
def authentication_keys(self, value):
"""
Sets the value of the `authentication_keys` property.
"""
self._authentication_keys = value
@property
def data_center(self):
"""
Returns the value of the `data_center` property.
"""
return self._data_center
@data_center.setter
def data_center(self, value):
"""
Sets the value of the `data_center` property.
"""
Struct._check_type('data_center', value, DataCenter)
self._data_center = value
@property
def volume_types(self):
"""
Returns the value of the `volume_types` property.
"""
return self._volume_types
@volume_types.setter
def volume_types(self, value):
"""
Sets the value of the `volume_types` property.
"""
self._volume_types = value
class Template(VmBase):
def __init__(
self,
auto_pinning_policy=None,
bios=None,
cdroms=None,
cluster=None,
comment=None,
console=None,
cpu=None,
cpu_pinning_policy=None,
cpu_profile=None,
cpu_shares=None,
creation_time=None,
custom_compatibility_version=None,
custom_cpu_model=None,
custom_emulated_machine=None,
custom_properties=None,
delete_protected=None,
description=None,
disk_attachments=None,
display=None,
domain=None,
graphics_consoles=None,
high_availability=None,
id=None,
initialization=None,
io=None,
large_icon=None,
lease=None,
mediated_devices=None,
memory=None,
memory_policy=None,
migration=None,
migration_downtime=None,
multi_queues_enabled=None,
name=None,
nics=None,
origin=None,
os=None,
permissions=None,
placement_policy=None,
quota=None,
rng_device=None,
serial_number=None,
small_icon=None,
soundcard_enabled=None,
sso=None,
start_paused=None,
stateless=None,
status=None,
storage_domain=None,
storage_error_resume_behaviour=None,
tags=None,
time_zone=None,
tpm_enabled=None,
tunnel_migration=None,
type=None,
usb=None,
version=None,
virtio_scsi=None,
virtio_scsi_multi_queues=None,
virtio_scsi_multi_queues_enabled=None,
vm=None,
watchdogs=None,
):
super(Template, self).__init__(
auto_pinning_policy=auto_pinning_policy,
bios=bios,
cluster=cluster,
comment=comment,
console=console,
cpu=cpu,
cpu_pinning_policy=cpu_pinning_policy,
cpu_profile=cpu_profile,
cpu_shares=cpu_shares,
creation_time=creation_time,
custom_compatibility_version=custom_compatibility_version,
custom_cpu_model=custom_cpu_model,
custom_emulated_machine=custom_emulated_machine,
custom_properties=custom_properties,
delete_protected=delete_protected,
description=description,
display=display,
domain=domain,
high_availability=high_availability,
id=id,
initialization=initialization,
io=io,
large_icon=large_icon,
lease=lease,
memory=memory,
memory_policy=memory_policy,
migration=migration,
migration_downtime=migration_downtime,
multi_queues_enabled=multi_queues_enabled,
name=name,
origin=origin,
os=os,
placement_policy=placement_policy,
quota=quota,
rng_device=rng_device,
serial_number=serial_number,
small_icon=small_icon,
soundcard_enabled=soundcard_enabled,
sso=sso,
start_paused=start_paused,
stateless=stateless,
storage_domain=storage_domain,
storage_error_resume_behaviour=storage_error_resume_behaviour,
time_zone=time_zone,
tpm_enabled=tpm_enabled,
tunnel_migration=tunnel_migration,
type=type,
usb=usb,
virtio_scsi=virtio_scsi,
virtio_scsi_multi_queues=virtio_scsi_multi_queues,
virtio_scsi_multi_queues_enabled=virtio_scsi_multi_queues_enabled,
)
self.cdroms = cdroms
self.disk_attachments = disk_attachments
self.graphics_consoles = graphics_consoles
self.mediated_devices = mediated_devices
self.nics = nics
self.permissions = permissions
self.status = status
self.tags = tags
self.version = version
self.vm = vm
self.watchdogs = watchdogs
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def version(self):
"""
Returns the value of the `version` property.
"""
return self._version
@version.setter
def version(self, value):
"""
Sets the value of the `version` property.
"""
Struct._check_type('version', value, TemplateVersion)
self._version = value
@property
def disk_attachments(self):
"""
Returns the value of the `disk_attachments` property.
"""
return self._disk_attachments
@disk_attachments.setter
def disk_attachments(self, value):
"""
Sets the value of the `disk_attachments` property.
"""
self._disk_attachments = value
@property
def mediated_devices(self):
"""
Returns the value of the `mediated_devices` property.
"""
return self._mediated_devices
@mediated_devices.setter
def mediated_devices(self, value):
"""
Sets the value of the `mediated_devices` property.
"""
self._mediated_devices = value
@property
def cdroms(self):
"""
Returns the value of the `cdroms` property.
"""
return self._cdroms
@cdroms.setter
def cdroms(self, value):
"""
Sets the value of the `cdroms` property.
"""
self._cdroms = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def graphics_consoles(self):
"""
Returns the value of the `graphics_consoles` property.
"""
return self._graphics_consoles
@graphics_consoles.setter
def graphics_consoles(self, value):
"""
Sets the value of the `graphics_consoles` property.
"""
self._graphics_consoles = value
@property
def nics(self):
"""
Returns the value of the `nics` property.
"""
return self._nics
@nics.setter
def nics(self, value):
"""
Sets the value of the `nics` property.
"""
self._nics = value
@property
def watchdogs(self):
"""
Returns the value of the `watchdogs` property.
"""
return self._watchdogs
@watchdogs.setter
def watchdogs(self, value):
"""
Sets the value of the `watchdogs` property.
"""
self._watchdogs = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, TemplateStatus)
self._status = value
@property
def tags(self):
"""
Returns the value of the `tags` property.
"""
return self._tags
@tags.setter
def tags(self, value):
"""
Sets the value of the `tags` property.
"""
self._tags = value
class Vm(VmBase):
def __init__(
self,
affinity_labels=None,
applications=None,
auto_pinning_policy=None,
bios=None,
cdroms=None,
cluster=None,
comment=None,
console=None,
cpu=None,
cpu_pinning_policy=None,
cpu_profile=None,
cpu_shares=None,
creation_time=None,
custom_compatibility_version=None,
custom_cpu_model=None,
custom_emulated_machine=None,
custom_properties=None,
delete_protected=None,
description=None,
disk_attachments=None,
display=None,
domain=None,
dynamic_cpu=None,
external_host_provider=None,
floppies=None,
fqdn=None,
graphics_consoles=None,
guest_operating_system=None,
guest_time_zone=None,
has_illegal_images=None,
high_availability=None,
host=None,
host_devices=None,
id=None,
initialization=None,
instance_type=None,
io=None,
katello_errata=None,
large_icon=None,
lease=None,
mediated_devices=None,
memory=None,
memory_policy=None,
migration=None,
migration_downtime=None,
multi_queues_enabled=None,
name=None,
next_run_configuration_exists=None,
nics=None,
numa_nodes=None,
numa_tune_mode=None,
origin=None,
original_template=None,
os=None,
payloads=None,
permissions=None,
placement_policy=None,
quota=None,
reported_devices=None,
rng_device=None,
run_once=None,
serial_number=None,
sessions=None,
small_icon=None,
snapshots=None,
soundcard_enabled=None,
sso=None,
start_paused=None,
start_time=None,
stateless=None,
statistics=None,
status=None,
status_detail=None,
stop_reason=None,
stop_time=None,
storage_domain=None,
storage_error_resume_behaviour=None,
tags=None,
template=None,
time_zone=None,
tpm_enabled=None,
tunnel_migration=None,
type=None,
usb=None,
use_latest_template_version=None,
virtio_scsi=None,
virtio_scsi_multi_queues=None,
virtio_scsi_multi_queues_enabled=None,
vm_pool=None,
watchdogs=None,
):
super(Vm, self).__init__(
auto_pinning_policy=auto_pinning_policy,
bios=bios,
cluster=cluster,
comment=comment,
console=console,
cpu=cpu,
cpu_pinning_policy=cpu_pinning_policy,
cpu_profile=cpu_profile,
cpu_shares=cpu_shares,
creation_time=creation_time,
custom_compatibility_version=custom_compatibility_version,
custom_cpu_model=custom_cpu_model,
custom_emulated_machine=custom_emulated_machine,
custom_properties=custom_properties,
delete_protected=delete_protected,
description=description,
display=display,
domain=domain,
high_availability=high_availability,
id=id,
initialization=initialization,
io=io,
large_icon=large_icon,
lease=lease,
memory=memory,
memory_policy=memory_policy,
migration=migration,
migration_downtime=migration_downtime,
multi_queues_enabled=multi_queues_enabled,
name=name,
origin=origin,
os=os,
placement_policy=placement_policy,
quota=quota,
rng_device=rng_device,
serial_number=serial_number,
small_icon=small_icon,
soundcard_enabled=soundcard_enabled,
sso=sso,
start_paused=start_paused,
stateless=stateless,
storage_domain=storage_domain,
storage_error_resume_behaviour=storage_error_resume_behaviour,
time_zone=time_zone,
tpm_enabled=tpm_enabled,
tunnel_migration=tunnel_migration,
type=type,
usb=usb,
virtio_scsi=virtio_scsi,
virtio_scsi_multi_queues=virtio_scsi_multi_queues,
virtio_scsi_multi_queues_enabled=virtio_scsi_multi_queues_enabled,
)
self.affinity_labels = affinity_labels
self.applications = applications
self.cdroms = cdroms
self.disk_attachments = disk_attachments
self.dynamic_cpu = dynamic_cpu
self.external_host_provider = external_host_provider
self.floppies = floppies
self.fqdn = fqdn
self.graphics_consoles = graphics_consoles
self.guest_operating_system = guest_operating_system
self.guest_time_zone = guest_time_zone
self.has_illegal_images = has_illegal_images
self.host = host
self.host_devices = host_devices
self.instance_type = instance_type
self.katello_errata = katello_errata
self.mediated_devices = mediated_devices
self.next_run_configuration_exists = next_run_configuration_exists
self.nics = nics
self.numa_nodes = numa_nodes
self.numa_tune_mode = numa_tune_mode
self.original_template = original_template
self.payloads = payloads
self.permissions = permissions
self.reported_devices = reported_devices
self.run_once = run_once
self.sessions = sessions
self.snapshots = snapshots
self.start_time = start_time
self.statistics = statistics
self.status = status
self.status_detail = status_detail
self.stop_reason = stop_reason
self.stop_time = stop_time
self.tags = tags
self.template = template
self.use_latest_template_version = use_latest_template_version
self.vm_pool = vm_pool
self.watchdogs = watchdogs
@property
def numa_tune_mode(self):
"""
Returns the value of the `numa_tune_mode` property.
"""
return self._numa_tune_mode
@numa_tune_mode.setter
def numa_tune_mode(self, value):
"""
Sets the value of the `numa_tune_mode` property.
"""
Struct._check_type('numa_tune_mode', value, NumaTuneMode)
self._numa_tune_mode = value
@property
def use_latest_template_version(self):
"""
Returns the value of the `use_latest_template_version` property.
"""
return self._use_latest_template_version
@use_latest_template_version.setter
def use_latest_template_version(self, value):
"""
Sets the value of the `use_latest_template_version` property.
"""
self._use_latest_template_version = value
@property
def reported_devices(self):
"""
Returns the value of the `reported_devices` property.
"""
return self._reported_devices
@reported_devices.setter
def reported_devices(self, value):
"""
Sets the value of the `reported_devices` property.
"""
self._reported_devices = value
@property
def dynamic_cpu(self):
"""
Returns the value of the `dynamic_cpu` property.
"""
return self._dynamic_cpu
@dynamic_cpu.setter
def dynamic_cpu(self, value):
"""
Sets the value of the `dynamic_cpu` property.
"""
Struct._check_type('dynamic_cpu', value, DynamicCpu)
self._dynamic_cpu = value
@property
def sessions(self):
"""
Returns the value of the `sessions` property.
"""
return self._sessions
@sessions.setter
def sessions(self, value):
"""
Sets the value of the `sessions` property.
"""
self._sessions = value
@property
def fqdn(self):
"""
Returns the value of the `fqdn` property.
"""
return self._fqdn
@fqdn.setter
def fqdn(self, value):
"""
Sets the value of the `fqdn` property.
"""
self._fqdn = value
@property
def cdroms(self):
"""
Returns the value of the `cdroms` property.
"""
return self._cdroms
@cdroms.setter
def cdroms(self, value):
"""
Sets the value of the `cdroms` property.
"""
self._cdroms = value
@property
def affinity_labels(self):
"""
Returns the value of the `affinity_labels` property.
"""
return self._affinity_labels
@affinity_labels.setter
def affinity_labels(self, value):
"""
Sets the value of the `affinity_labels` property.
"""
self._affinity_labels = value
@property
def floppies(self):
"""
Returns the value of the `floppies` property.
"""
return self._floppies
@floppies.setter
def floppies(self, value):
"""
Sets the value of the `floppies` property.
"""
self._floppies = value
@property
def stop_time(self):
"""
Returns the value of the `stop_time` property.
"""
return self._stop_time
@stop_time.setter
def stop_time(self, value):
"""
Sets the value of the `stop_time` property.
"""
self._stop_time = value
@property
def tags(self):
"""
Returns the value of the `tags` property.
"""
return self._tags
@tags.setter
def tags(self, value):
"""
Sets the value of the `tags` property.
"""
self._tags = value
@property
def host_devices(self):
"""
Returns the value of the `host_devices` property.
"""
return self._host_devices
@host_devices.setter
def host_devices(self, value):
"""
Sets the value of the `host_devices` property.
"""
self._host_devices = value
@property
def snapshots(self):
"""
Returns the value of the `snapshots` property.
"""
return self._snapshots
@snapshots.setter
def snapshots(self, value):
"""
Sets the value of the `snapshots` property.
"""
self._snapshots = value
@property
def disk_attachments(self):
"""
Returns the value of the `disk_attachments` property.
"""
return self._disk_attachments
@disk_attachments.setter
def disk_attachments(self, value):
"""
Sets the value of the `disk_attachments` property.
"""
self._disk_attachments = value
@property
def stop_reason(self):
"""
Returns the value of the `stop_reason` property.
"""
return self._stop_reason
@stop_reason.setter
def stop_reason(self, value):
"""
Sets the value of the `stop_reason` property.
"""
self._stop_reason = value
@property
def original_template(self):
"""
Returns the value of the `original_template` property.
"""
return self._original_template
@original_template.setter
def original_template(self, value):
"""
Sets the value of the `original_template` property.
"""
Struct._check_type('original_template', value, Template)
self._original_template = value
@property
def mediated_devices(self):
"""
Returns the value of the `mediated_devices` property.
"""
return self._mediated_devices
@mediated_devices.setter
def mediated_devices(self, value):
"""
Sets the value of the `mediated_devices` property.
"""
self._mediated_devices = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, VmStatus)
self._status = value
@property
def next_run_configuration_exists(self):
"""
Returns the value of the `next_run_configuration_exists` property.
"""
return self._next_run_configuration_exists
@next_run_configuration_exists.setter
def next_run_configuration_exists(self, value):
"""
Sets the value of the `next_run_configuration_exists` property.
"""
self._next_run_configuration_exists = value
@property
def applications(self):
"""
Returns the value of the `applications` property.
"""
return self._applications
@applications.setter
def applications(self, value):
"""
Sets the value of the `applications` property.
"""
self._applications = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
@property
def katello_errata(self):
"""
Returns the value of the `katello_errata` property.
"""
return self._katello_errata
@katello_errata.setter
def katello_errata(self, value):
"""
Sets the value of the `katello_errata` property.
"""
self._katello_errata = value
@property
def template(self):
"""
Returns the value of the `template` property.
"""
return self._template
@template.setter
def template(self, value):
"""
Sets the value of the `template` property.
"""
Struct._check_type('template', value, Template)
self._template = value
@property
def payloads(self):
"""
Returns the value of the `payloads` property.
"""
return self._payloads
@payloads.setter
def payloads(self, value):
"""
Sets the value of the `payloads` property.
"""
self._payloads = value
@property
def start_time(self):
"""
Returns the value of the `start_time` property.
"""
return self._start_time
@start_time.setter
def start_time(self, value):
"""
Sets the value of the `start_time` property.
"""
self._start_time = value
@property
def graphics_consoles(self):
"""
Returns the value of the `graphics_consoles` property.
"""
return self._graphics_consoles
@graphics_consoles.setter
def graphics_consoles(self, value):
"""
Sets the value of the `graphics_consoles` property.
"""
self._graphics_consoles = value
@property
def watchdogs(self):
"""
Returns the value of the `watchdogs` property.
"""
return self._watchdogs
@watchdogs.setter
def watchdogs(self, value):
"""
Sets the value of the `watchdogs` property.
"""
self._watchdogs = value
@property
def guest_time_zone(self):
"""
Returns the value of the `guest_time_zone` property.
"""
return self._guest_time_zone
@guest_time_zone.setter
def guest_time_zone(self, value):
"""
Sets the value of the `guest_time_zone` property.
"""
Struct._check_type('guest_time_zone', value, TimeZone)
self._guest_time_zone = value
@property
def guest_operating_system(self):
"""
Returns the value of the `guest_operating_system` property.
"""
return self._guest_operating_system
@guest_operating_system.setter
def guest_operating_system(self, value):
"""
Sets the value of the `guest_operating_system` property.
"""
Struct._check_type('guest_operating_system', value, GuestOperatingSystem)
self._guest_operating_system = value
@property
def vm_pool(self):
"""
Returns the value of the `vm_pool` property.
"""
return self._vm_pool
@vm_pool.setter
def vm_pool(self, value):
"""
Sets the value of the `vm_pool` property.
"""
Struct._check_type('vm_pool', value, VmPool)
self._vm_pool = value
@property
def numa_nodes(self):
"""
Returns the value of the `numa_nodes` property.
"""
return self._numa_nodes
@numa_nodes.setter
def numa_nodes(self, value):
"""
Sets the value of the `numa_nodes` property.
"""
self._numa_nodes = value
@property
def permissions(self):
"""
Returns the value of the `permissions` property.
"""
return self._permissions
@permissions.setter
def permissions(self, value):
"""
Sets the value of the `permissions` property.
"""
self._permissions = value
@property
def has_illegal_images(self):
"""
Returns the value of the `has_illegal_images` property.
"""
return self._has_illegal_images
@has_illegal_images.setter
def has_illegal_images(self, value):
"""
Sets the value of the `has_illegal_images` property.
"""
self._has_illegal_images = value
@property
def external_host_provider(self):
"""
Returns the value of the `external_host_provider` property.
"""
return self._external_host_provider
@external_host_provider.setter
def external_host_provider(self, value):
"""
Sets the value of the `external_host_provider` property.
"""
Struct._check_type('external_host_provider', value, ExternalHostProvider)
self._external_host_provider = value
@property
def instance_type(self):
"""
Returns the value of the `instance_type` property.
"""
return self._instance_type
@instance_type.setter
def instance_type(self, value):
"""
Sets the value of the `instance_type` property.
"""
Struct._check_type('instance_type', value, InstanceType)
self._instance_type = value
@property
def status_detail(self):
"""
Returns the value of the `status_detail` property.
"""
return self._status_detail
@status_detail.setter
def status_detail(self, value):
"""
Sets the value of the `status_detail` property.
"""
self._status_detail = value
@property
def host(self):
"""
Returns the value of the `host` property.
"""
return self._host
@host.setter
def host(self, value):
"""
Sets the value of the `host` property.
"""
Struct._check_type('host', value, Host)
self._host = value
@property
def nics(self):
"""
Returns the value of the `nics` property.
"""
return self._nics
@nics.setter
def nics(self, value):
"""
Sets the value of the `nics` property.
"""
self._nics = value
@property
def run_once(self):
"""
Returns the value of the `run_once` property.
"""
return self._run_once
@run_once.setter
def run_once(self, value):
"""
Sets the value of the `run_once` property.
"""
self._run_once = value
class VmMediatedDevice(Device):
def __init__(
self,
comment=None,
description=None,
id=None,
instance_type=None,
name=None,
spec_params=None,
template=None,
vm=None,
vms=None,
):
super(VmMediatedDevice, self).__init__(
comment=comment,
description=description,
id=id,
instance_type=instance_type,
name=name,
template=template,
vm=vm,
vms=vms,
)
self.spec_params = spec_params
@property
def spec_params(self):
"""
Returns the value of the `spec_params` property.
"""
return self._spec_params
@spec_params.setter
def spec_params(self, value):
"""
Sets the value of the `spec_params` property.
"""
self._spec_params = value
class Watchdog(Device):
def __init__(
self,
action=None,
comment=None,
description=None,
id=None,
instance_type=None,
model=None,
name=None,
template=None,
vm=None,
vms=None,
):
super(Watchdog, self).__init__(
comment=comment,
description=description,
id=id,
instance_type=instance_type,
name=name,
template=template,
vm=vm,
vms=vms,
)
self.action = action
self.model = model
@property
def action(self):
"""
Returns the value of the `action` property.
"""
return self._action
@action.setter
def action(self, value):
"""
Sets the value of the `action` property.
"""
Struct._check_type('action', value, WatchdogAction)
self._action = value
@property
def model(self):
"""
Returns the value of the `model` property.
"""
return self._model
@model.setter
def model(self, value):
"""
Sets the value of the `model` property.
"""
Struct._check_type('model', value, WatchdogModel)
self._model = value
class Cdrom(Device):
def __init__(
self,
comment=None,
description=None,
file=None,
id=None,
instance_type=None,
name=None,
template=None,
vm=None,
vms=None,
):
super(Cdrom, self).__init__(
comment=comment,
description=description,
id=id,
instance_type=instance_type,
name=name,
template=template,
vm=vm,
vms=vms,
)
self.file = file
@property
def file(self):
"""
Returns the value of the `file` property.
"""
return self._file
@file.setter
def file(self, value):
"""
Sets the value of the `file` property.
"""
Struct._check_type('file', value, File)
self._file = value
class ExternalHostProvider(ExternalProvider):
def __init__(
self,
authentication_url=None,
certificates=None,
comment=None,
compute_resources=None,
description=None,
discovered_hosts=None,
host_groups=None,
hosts=None,
id=None,
name=None,
password=None,
properties=None,
requires_authentication=None,
url=None,
username=None,
):
super(ExternalHostProvider, self).__init__(
authentication_url=authentication_url,
comment=comment,
description=description,
id=id,
name=name,
password=password,
properties=properties,
requires_authentication=requires_authentication,
url=url,
username=username,
)
self.certificates = certificates
self.compute_resources = compute_resources
self.discovered_hosts = discovered_hosts
self.host_groups = host_groups
self.hosts = hosts
@property
def certificates(self):
"""
Returns the value of the `certificates` property.
"""
return self._certificates
@certificates.setter
def certificates(self, value):
"""
Sets the value of the `certificates` property.
"""
self._certificates = value
@property
def host_groups(self):
"""
Returns the value of the `host_groups` property.
"""
return self._host_groups
@host_groups.setter
def host_groups(self, value):
"""
Sets the value of the `host_groups` property.
"""
self._host_groups = value
@property
def hosts(self):
"""
Returns the value of the `hosts` property.
"""
return self._hosts
@hosts.setter
def hosts(self, value):
"""
Sets the value of the `hosts` property.
"""
self._hosts = value
@property
def compute_resources(self):
"""
Returns the value of the `compute_resources` property.
"""
return self._compute_resources
@compute_resources.setter
def compute_resources(self, value):
"""
Sets the value of the `compute_resources` property.
"""
self._compute_resources = value
@property
def discovered_hosts(self):
"""
Returns the value of the `discovered_hosts` property.
"""
return self._discovered_hosts
@discovered_hosts.setter
def discovered_hosts(self, value):
"""
Sets the value of the `discovered_hosts` property.
"""
self._discovered_hosts = value
class GlusterBrick(GlusterBrickAdvancedDetails):
def __init__(
self,
brick_dir=None,
comment=None,
description=None,
device=None,
fs_name=None,
gluster_clients=None,
gluster_volume=None,
id=None,
instance_type=None,
memory_pools=None,
mnt_options=None,
name=None,
pid=None,
port=None,
server_id=None,
statistics=None,
status=None,
template=None,
vm=None,
vms=None,
):
super(GlusterBrick, self).__init__(
comment=comment,
description=description,
device=device,
fs_name=fs_name,
gluster_clients=gluster_clients,
id=id,
instance_type=instance_type,
memory_pools=memory_pools,
mnt_options=mnt_options,
name=name,
pid=pid,
port=port,
template=template,
vm=vm,
vms=vms,
)
self.brick_dir = brick_dir
self.gluster_volume = gluster_volume
self.server_id = server_id
self.statistics = statistics
self.status = status
@property
def brick_dir(self):
"""
Returns the value of the `brick_dir` property.
"""
return self._brick_dir
@brick_dir.setter
def brick_dir(self, value):
"""
Sets the value of the `brick_dir` property.
"""
self._brick_dir = value
@property
def server_id(self):
"""
Returns the value of the `server_id` property.
"""
return self._server_id
@server_id.setter
def server_id(self, value):
"""
Sets the value of the `server_id` property.
"""
self._server_id = value
@property
def gluster_volume(self):
"""
Returns the value of the `gluster_volume` property.
"""
return self._gluster_volume
@gluster_volume.setter
def gluster_volume(self, value):
"""
Sets the value of the `gluster_volume` property.
"""
Struct._check_type('gluster_volume', value, GlusterVolume)
self._gluster_volume = value
@property
def status(self):
"""
Returns the value of the `status` property.
"""
return self._status
@status.setter
def status(self, value):
"""
Sets the value of the `status` property.
"""
Struct._check_type('status', value, GlusterBrickStatus)
self._status = value
@property
def statistics(self):
"""
Returns the value of the `statistics` property.
"""
return self._statistics
@statistics.setter
def statistics(self, value):
"""
Sets the value of the `statistics` property.
"""
self._statistics = value
class InstanceType(Template):
def __init__(
self,
auto_pinning_policy=None,
bios=None,
cdroms=None,
cluster=None,
comment=None,
console=None,
cpu=None,
cpu_pinning_policy=None,
cpu_profile=None,
cpu_shares=None,
creation_time=None,
custom_compatibility_version=None,
custom_cpu_model=None,
custom_emulated_machine=None,
custom_properties=None,
delete_protected=None,
description=None,
disk_attachments=None,
display=None,
domain=None,
graphics_consoles=None,
high_availability=None,
id=None,
initialization=None,
io=None,
large_icon=None,
lease=None,
mediated_devices=None,
memory=None,
memory_policy=None,
migration=None,
migration_downtime=None,
multi_queues_enabled=None,
name=None,
nics=None,
origin=None,
os=None,
permissions=None,
placement_policy=None,
quota=None,
rng_device=None,
serial_number=None,
small_icon=None,
soundcard_enabled=None,
sso=None,
start_paused=None,
stateless=None,
status=None,
storage_domain=None,
storage_error_resume_behaviour=None,
tags=None,
time_zone=None,
tpm_enabled=None,
tunnel_migration=None,
type=None,
usb=None,
version=None,
virtio_scsi=None,
virtio_scsi_multi_queues=None,
virtio_scsi_multi_queues_enabled=None,
vm=None,
watchdogs=None,
):
super(InstanceType, self).__init__(
auto_pinning_policy=auto_pinning_policy,
bios=bios,
cdroms=cdroms,
cluster=cluster,
comment=comment,
console=console,
cpu=cpu,
cpu_pinning_policy=cpu_pinning_policy,
cpu_profile=cpu_profile,
cpu_shares=cpu_shares,
creation_time=creation_time,
custom_compatibility_version=custom_compatibility_version,
custom_cpu_model=custom_cpu_model,
custom_emulated_machine=custom_emulated_machine,
custom_properties=custom_properties,
delete_protected=delete_protected,
description=description,
disk_attachments=disk_attachments,
display=display,
domain=domain,
graphics_consoles=graphics_consoles,
high_availability=high_availability,
id=id,
initialization=initialization,
io=io,
large_icon=large_icon,
lease=lease,
mediated_devices=mediated_devices,
memory=memory,
memory_policy=memory_policy,
migration=migration,
migration_downtime=migration_downtime,
multi_queues_enabled=multi_queues_enabled,
name=name,
nics=nics,
origin=origin,
os=os,
permissions=permissions,
placement_policy=placement_policy,
quota=quota,
rng_device=rng_device,
serial_number=serial_number,
small_icon=small_icon,
soundcard_enabled=soundcard_enabled,
sso=sso,
start_paused=start_paused,
stateless=stateless,
status=status,
storage_domain=storage_domain,
storage_error_resume_behaviour=storage_error_resume_behaviour,
tags=tags,
time_zone=time_zone,
tpm_enabled=tpm_enabled,
tunnel_migration=tunnel_migration,
type=type,
usb=usb,
version=version,
virtio_scsi=virtio_scsi,
virtio_scsi_multi_queues=virtio_scsi_multi_queues,
virtio_scsi_multi_queues_enabled=virtio_scsi_multi_queues_enabled,
vm=vm,
watchdogs=watchdogs,
)
pass
class OpenStackImageProvider(OpenStackProvider):
def __init__(
self,
authentication_url=None,
certificates=None,
comment=None,
description=None,
id=None,
images=None,
name=None,
password=None,
properties=None,
requires_authentication=None,
tenant_name=None,
url=None,
username=None,
):
super(OpenStackImageProvider, self).__init__(
authentication_url=authentication_url,
comment=comment,
description=description,
id=id,
name=name,
password=password,
properties=properties,
requires_authentication=requires_authentication,
tenant_name=tenant_name,
url=url,
username=username,
)
self.certificates = certificates
self.images = images
@property
def certificates(self):
"""
Returns the value of the `certificates` property.
"""
return self._certificates
@certificates.setter
def certificates(self, value):
"""
Sets the value of the `certificates` property.
"""
self._certificates = value
@property
def images(self):
"""
Returns the value of the `images` property.
"""
return self._images
@images.setter
def images(self, value):
"""
Sets the value of the `images` property.
"""
self._images = value
class OpenStackNetworkProvider(OpenStackProvider):
def __init__(
self,
agent_configuration=None,
authentication_url=None,
auto_sync=None,
certificates=None,
comment=None,
description=None,
external_plugin_type=None,
id=None,
name=None,
networks=None,
password=None,
plugin_type=None,
project_domain_name=None,
project_name=None,
properties=None,
read_only=None,
requires_authentication=None,
subnets=None,
tenant_name=None,
type=None,
unmanaged=None,
url=None,
user_domain_name=None,
username=None,
):
super(OpenStackNetworkProvider, self).__init__(
authentication_url=authentication_url,
comment=comment,
description=description,
id=id,
name=name,
password=password,
properties=properties,
requires_authentication=requires_authentication,
tenant_name=tenant_name,
url=url,
username=username,
)
self.agent_configuration = agent_configuration
self.auto_sync = auto_sync
self.certificates = certificates
self.external_plugin_type = external_plugin_type
self.networks = networks
self.plugin_type = plugin_type
self.project_domain_name = project_domain_name
self.project_name = project_name
self.read_only = read_only
self.subnets = subnets
self.type = type
self.unmanaged = unmanaged
self.user_domain_name = user_domain_name
@property
def agent_configuration(self):
"""
Returns the value of the `agent_configuration` property.
"""
return self._agent_configuration
@agent_configuration.setter
def agent_configuration(self, value):
"""
Sets the value of the `agent_configuration` property.
"""
Struct._check_type('agent_configuration', value, AgentConfiguration)
self._agent_configuration = value
@property
def networks(self):
"""
Returns the value of the `networks` property.
"""
return self._networks
@networks.setter
def networks(self, value):
"""
Sets the value of the `networks` property.
"""
self._networks = value
@property
def auto_sync(self):
"""
Returns the value of the `auto_sync` property.
"""
return self._auto_sync
@auto_sync.setter
def auto_sync(self, value):
"""
Sets the value of the `auto_sync` property.
"""
self._auto_sync = value
@property
def type(self):
"""
Returns the value of the `type` property.
"""
return self._type
@type.setter
def type(self, value):
"""
Sets the value of the `type` property.
"""
Struct._check_type('type', value, OpenStackNetworkProviderType)
self._type = value
@property
def certificates(self):
"""
Returns the value of the `certificates` property.
"""
return self._certificates
@certificates.setter
def certificates(self, value):
"""
Sets the value of the `certificates` property.
"""
self._certificates = value
@property
def unmanaged(self):
"""
Returns the value of the `unmanaged` property.
"""
return self._unmanaged
@unmanaged.setter
def unmanaged(self, value):
"""
Sets the value of the `unmanaged` property.
"""
self._unmanaged = value
@property
def user_domain_name(self):
"""
Returns the value of the `user_domain_name` property.
"""
return self._user_domain_name
@user_domain_name.setter
def user_domain_name(self, value):
"""
Sets the value of the `user_domain_name` property.
"""
self._user_domain_name = value
@property
def plugin_type(self):
"""
Returns the value of the `plugin_type` property.
"""
return self._plugin_type
@plugin_type.setter
def plugin_type(self, value):
"""
Sets the value of the `plugin_type` property.
"""
Struct._check_type('plugin_type', value, NetworkPluginType)
self._plugin_type = value
@property
def subnets(self):
"""
Returns the value of the `subnets` property.
"""
return self._subnets
@subnets.setter
def subnets(self, value):
"""
Sets the value of the `subnets` property.
"""
self._subnets = value
@property
def project_domain_name(self):
"""
Returns the value of the `project_domain_name` property.
"""
return self._project_domain_name
@project_domain_name.setter
def project_domain_name(self, value):
"""
Sets the value of the `project_domain_name` property.
"""
self._project_domain_name = value
@property
def external_plugin_type(self):
"""
Returns the value of the `external_plugin_type` property.
"""
return self._external_plugin_type
@external_plugin_type.setter
def external_plugin_type(self, value):
"""
Sets the value of the `external_plugin_type` property.
"""
self._external_plugin_type = value
@property
def read_only(self):
"""
Returns the value of the `read_only` property.
"""
return self._read_only
@read_only.setter
def read_only(self, value):
"""
Sets the value of the `read_only` property.
"""
self._read_only = value
@property
def project_name(self):
"""
Returns the value of the `project_name` property.
"""
return self._project_name
@project_name.setter
def project_name(self, value):
"""
Sets the value of the `project_name` property.
"""
self._project_name = value
class Snapshot(Vm):
def __init__(
self,
affinity_labels=None,
applications=None,
auto_pinning_policy=None,
bios=None,
cdroms=None,
cluster=None,
comment=None,
console=None,
cpu=None,
cpu_pinning_policy=None,
cpu_profile=None,
cpu_shares=None,
creation_time=None,
custom_compatibility_version=None,
custom_cpu_model=None,
custom_emulated_machine=None,
custom_properties=None,
date=None,
delete_protected=None,
description=None,
disk_attachments=None,
disks=None,
display=None,
domain=None,
dynamic_cpu=None,
external_host_provider=None,
floppies=None,
fqdn=None,
graphics_consoles=None,
guest_operating_system=None,
guest_time_zone=None,
has_illegal_images=None,
high_availability=None,
host=None,
host_devices=None,
id=None,
initialization=None,
instance_type=None,
io=None,
katello_errata=None,
large_icon=None,
lease=None,
mediated_devices=None,
memory=None,
memory_policy=None,
migration=None,
migration_downtime=None,
multi_queues_enabled=None,
name=None,
next_run_configuration_exists=None,
nics=None,
numa_nodes=None,
numa_tune_mode=None,
origin=None,
original_template=None,
os=None,
payloads=None,
permissions=None,
persist_memorystate=None,
placement_policy=None,
quota=None,
reported_devices=None,
rng_device=None,
run_once=None,
serial_number=None,
sessions=None,
small_icon=None,
snapshot_status=None,
snapshot_type=None,
snapshots=None,
soundcard_enabled=None,
sso=None,
start_paused=None,
start_time=None,
stateless=None,
statistics=None,
status=None,
status_detail=None,
stop_reason=None,
stop_time=None,
storage_domain=None,
storage_error_resume_behaviour=None,
tags=None,
template=None,
time_zone=None,
tpm_enabled=None,
tunnel_migration=None,
type=None,
usb=None,
use_latest_template_version=None,
virtio_scsi=None,
virtio_scsi_multi_queues=None,
virtio_scsi_multi_queues_enabled=None,
vm=None,
vm_pool=None,
watchdogs=None,
):
super(Snapshot, self).__init__(
affinity_labels=affinity_labels,
applications=applications,
auto_pinning_policy=auto_pinning_policy,
bios=bios,
cdroms=cdroms,
cluster=cluster,
comment=comment,
console=console,
cpu=cpu,
cpu_pinning_policy=cpu_pinning_policy,
cpu_profile=cpu_profile,
cpu_shares=cpu_shares,
creation_time=creation_time,
custom_compatibility_version=custom_compatibility_version,
custom_cpu_model=custom_cpu_model,
custom_emulated_machine=custom_emulated_machine,
custom_properties=custom_properties,
delete_protected=delete_protected,
description=description,
disk_attachments=disk_attachments,
display=display,
domain=domain,
dynamic_cpu=dynamic_cpu,
external_host_provider=external_host_provider,
floppies=floppies,
fqdn=fqdn,
graphics_consoles=graphics_consoles,
guest_operating_system=guest_operating_system,
guest_time_zone=guest_time_zone,
has_illegal_images=has_illegal_images,
high_availability=high_availability,
host=host,
host_devices=host_devices,
id=id,
initialization=initialization,
instance_type=instance_type,
io=io,
katello_errata=katello_errata,
large_icon=large_icon,
lease=lease,
mediated_devices=mediated_devices,
memory=memory,
memory_policy=memory_policy,
migration=migration,
migration_downtime=migration_downtime,
multi_queues_enabled=multi_queues_enabled,
name=name,
next_run_configuration_exists=next_run_configuration_exists,
nics=nics,
numa_nodes=numa_nodes,
numa_tune_mode=numa_tune_mode,
origin=origin,
original_template=original_template,
os=os,
payloads=payloads,
permissions=permissions,
placement_policy=placement_policy,
quota=quota,
reported_devices=reported_devices,
rng_device=rng_device,
run_once=run_once,
serial_number=serial_number,
sessions=sessions,
small_icon=small_icon,
snapshots=snapshots,
soundcard_enabled=soundcard_enabled,
sso=sso,
start_paused=start_paused,
start_time=start_time,
stateless=stateless,
statistics=statistics,
status=status,
status_detail=status_detail,
stop_reason=stop_reason,
stop_time=stop_time,
storage_domain=storage_domain,
storage_error_resume_behaviour=storage_error_resume_behaviour,
tags=tags,
template=template,
time_zone=time_zone,
tpm_enabled=tpm_enabled,
tunnel_migration=tunnel_migration,
type=type,
usb=usb,
use_latest_template_version=use_latest_template_version,
virtio_scsi=virtio_scsi,
virtio_scsi_multi_queues=virtio_scsi_multi_queues,
virtio_scsi_multi_queues_enabled=virtio_scsi_multi_queues_enabled,
vm_pool=vm_pool,
watchdogs=watchdogs,
)
self.date = date
self.disks = disks
self.persist_memorystate = persist_memorystate
self.snapshot_status = snapshot_status
self.snapshot_type = snapshot_type
self.vm = vm
@property
def snapshot_type(self):
"""
Returns the value of the `snapshot_type` property.
"""
return self._snapshot_type
@snapshot_type.setter
def snapshot_type(self, value):
"""
Sets the value of the `snapshot_type` property.
"""
Struct._check_type('snapshot_type', value, SnapshotType)
self._snapshot_type = value
@property
def snapshot_status(self):
"""
Returns the value of the `snapshot_status` property.
"""
return self._snapshot_status
@snapshot_status.setter
def snapshot_status(self, value):
"""
Sets the value of the `snapshot_status` property.
"""
Struct._check_type('snapshot_status', value, SnapshotStatus)
self._snapshot_status = value
@property
def date(self):
"""
Returns the value of the `date` property.
"""
return self._date
@date.setter
def date(self, value):
"""
Sets the value of the `date` property.
"""
self._date = value
@property
def vm(self):
"""
Returns the value of the `vm` property.
"""
return self._vm
@vm.setter
def vm(self, value):
"""
Sets the value of the `vm` property.
"""
Struct._check_type('vm', value, Vm)
self._vm = value
@property
def disks(self):
"""
Returns the value of the `disks` property.
"""
return self._disks
@disks.setter
def disks(self, value):
"""
Sets the value of the `disks` property.
"""
self._disks = value
@property
def persist_memorystate(self):
"""
Returns the value of the `persist_memorystate` property.
"""
return self._persist_memorystate
@persist_memorystate.setter
def persist_memorystate(self, value):
"""
Sets the value of the `persist_memorystate` property.
"""
self._persist_memorystate = value
@unique
class AccessProtocol(Enum):
CIFS = 'cifs'
GLUSTER = 'gluster'
NFS = 'nfs'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class Architecture(Enum):
AARCH64 = 'aarch64'
PPC64 = 'ppc64'
S390X = 's390x'
UNDEFINED = 'undefined'
X86_64 = 'x86_64'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class AutoNumaStatus(Enum):
DISABLE = 'disable'
ENABLE = 'enable'
UNKNOWN = 'unknown'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class AutoPinningPolicy(Enum):
ADJUST = 'adjust'
DISABLED = 'disabled'
EXISTING = 'existing'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class BackupPhase(Enum):
FAILED = 'failed'
FINALIZING = 'finalizing'
INITIALIZING = 'initializing'
READY = 'ready'
STARTING = 'starting'
SUCCEEDED = 'succeeded'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class BiosType(Enum):
CLUSTER_DEFAULT = 'cluster_default'
I440FX_SEA_BIOS = 'i440fx_sea_bios'
Q35_OVMF = 'q35_ovmf'
Q35_SEA_BIOS = 'q35_sea_bios'
Q35_SECURE_BOOT = 'q35_secure_boot'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class BootDevice(Enum):
CDROM = 'cdrom'
HD = 'hd'
NETWORK = 'network'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class BootProtocol(Enum):
AUTOCONF = 'autoconf'
DHCP = 'dhcp'
NONE = 'none'
POLY_DHCP_AUTOCONF = 'poly_dhcp_autoconf'
STATIC = 'static'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class CheckpointState(Enum):
CREATED = 'created'
INVALID = 'invalid'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class CloudInitNetworkProtocol(Enum):
ENI = 'eni'
OPENSTACK_METADATA = 'openstack_metadata'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ClusterUpgradeAction(Enum):
FINISH = 'finish'
START = 'start'
UPDATE_PROGRESS = 'update_progress'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ConfigurationType(Enum):
OVA = 'ova'
OVF = 'ovf'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class CpuMode(Enum):
CUSTOM = 'custom'
HOST_MODEL = 'host_model'
HOST_PASSTHROUGH = 'host_passthrough'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class CpuPinningPolicy(Enum):
DEDICATED = 'dedicated'
MANUAL = 'manual'
NONE = 'none'
RESIZE_AND_PIN_NUMA = 'resize_and_pin_numa'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class CreationStatus(Enum):
COMPLETE = 'complete'
FAILED = 'failed'
IN_PROGRESS = 'in_progress'
PENDING = 'pending'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DataCenterStatus(Enum):
CONTEND = 'contend'
MAINTENANCE = 'maintenance'
NOT_OPERATIONAL = 'not_operational'
PROBLEMATIC = 'problematic'
UNINITIALIZED = 'uninitialized'
UP = 'up'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskBackup(Enum):
INCREMENTAL = 'incremental'
NONE = 'none'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskBackupMode(Enum):
FULL = 'full'
INCREMENTAL = 'incremental'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskContentType(Enum):
BACKUP_SCRATCH = 'backup_scratch'
DATA = 'data'
HOSTED_ENGINE = 'hosted_engine'
HOSTED_ENGINE_CONFIGURATION = 'hosted_engine_configuration'
HOSTED_ENGINE_METADATA = 'hosted_engine_metadata'
HOSTED_ENGINE_SANLOCK = 'hosted_engine_sanlock'
ISO = 'iso'
MEMORY_DUMP_VOLUME = 'memory_dump_volume'
MEMORY_METADATA_VOLUME = 'memory_metadata_volume'
OVF_STORE = 'ovf_store'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskFormat(Enum):
COW = 'cow'
RAW = 'raw'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskInterface(Enum):
IDE = 'ide'
SATA = 'sata'
SPAPR_VSCSI = 'spapr_vscsi'
VIRTIO = 'virtio'
VIRTIO_SCSI = 'virtio_scsi'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskStatus(Enum):
ILLEGAL = 'illegal'
LOCKED = 'locked'
OK = 'ok'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskStorageType(Enum):
CINDER = 'cinder'
IMAGE = 'image'
LUN = 'lun'
MANAGED_BLOCK_STORAGE = 'managed_block_storage'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DiskType(Enum):
DATA = 'data'
SYSTEM = 'system'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class DisplayType(Enum):
SPICE = 'spice'
VNC = 'vnc'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class EntityExternalStatus(Enum):
ERROR = 'error'
FAILURE = 'failure'
INFO = 'info'
OK = 'ok'
WARNING = 'warning'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ExternalStatus(Enum):
ERROR = 'error'
FAILURE = 'failure'
INFO = 'info'
OK = 'ok'
WARNING = 'warning'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ExternalSystemType(Enum):
GLUSTER = 'gluster'
VDSM = 'vdsm'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ExternalVmProviderType(Enum):
KVM = 'kvm'
VMWARE = 'vmware'
XEN = 'xen'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class FenceType(Enum):
MANUAL = 'manual'
RESTART = 'restart'
START = 'start'
STATUS = 'status'
STOP = 'stop'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class FipsMode(Enum):
DISABLED = 'disabled'
ENABLED = 'enabled'
UNDEFINED = 'undefined'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class FirewallType(Enum):
FIREWALLD = 'firewalld'
IPTABLES = 'iptables'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class GlusterBrickStatus(Enum):
DOWN = 'down'
UNKNOWN = 'unknown'
UP = 'up'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class GlusterHookStatus(Enum):
DISABLED = 'disabled'
ENABLED = 'enabled'
MISSING = 'missing'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class GlusterState(Enum):
DOWN = 'down'
UNKNOWN = 'unknown'
UP = 'up'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class GlusterVolumeStatus(Enum):
DOWN = 'down'
UNKNOWN = 'unknown'
UP = 'up'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class GlusterVolumeType(Enum):
DISPERSE = 'disperse'
DISTRIBUTE = 'distribute'
DISTRIBUTED_DISPERSE = 'distributed_disperse'
DISTRIBUTED_REPLICATE = 'distributed_replicate'
DISTRIBUTED_STRIPE = 'distributed_stripe'
DISTRIBUTED_STRIPED_REPLICATE = 'distributed_striped_replicate'
REPLICATE = 'replicate'
STRIPE = 'stripe'
STRIPED_REPLICATE = 'striped_replicate'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class GraphicsType(Enum):
SPICE = 'spice'
VNC = 'vnc'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class HookContentType(Enum):
BINARY = 'binary'
TEXT = 'text'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class HookStage(Enum):
POST = 'post'
PRE = 'pre'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class HookStatus(Enum):
DISABLED = 'disabled'
ENABLED = 'enabled'
MISSING = 'missing'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class HostProtocol(Enum):
STOMP = 'stomp'
XML = 'xml'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class HostStatus(Enum):
CONNECTING = 'connecting'
DOWN = 'down'
ERROR = 'error'
INITIALIZING = 'initializing'
INSTALL_FAILED = 'install_failed'
INSTALLING = 'installing'
INSTALLING_OS = 'installing_os'
KDUMPING = 'kdumping'
MAINTENANCE = 'maintenance'
NON_OPERATIONAL = 'non_operational'
NON_RESPONSIVE = 'non_responsive'
PENDING_APPROVAL = 'pending_approval'
PREPARING_FOR_MAINTENANCE = 'preparing_for_maintenance'
REBOOT = 'reboot'
UNASSIGNED = 'unassigned'
UP = 'up'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class HostType(Enum):
OVIRT_NODE = 'ovirt_node'
RHEL = 'rhel'
RHEV_H = 'rhev_h'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ImageFileType(Enum):
DISK = 'disk'
FLOPPY = 'floppy'
ISO = 'iso'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ImageTransferDirection(Enum):
DOWNLOAD = 'download'
UPLOAD = 'upload'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ImageTransferPhase(Enum):
CANCELLED = 'cancelled'
CANCELLED_SYSTEM = 'cancelled_system'
CANCELLED_USER = 'cancelled_user'
FINALIZING_CLEANUP = 'finalizing_cleanup'
FINALIZING_FAILURE = 'finalizing_failure'
FINALIZING_SUCCESS = 'finalizing_success'
FINISHED_CLEANUP = 'finished_cleanup'
FINISHED_FAILURE = 'finished_failure'
FINISHED_SUCCESS = 'finished_success'
INITIALIZING = 'initializing'
PAUSED_SYSTEM = 'paused_system'
PAUSED_USER = 'paused_user'
RESUMING = 'resuming'
TRANSFERRING = 'transferring'
UNKNOWN = 'unknown'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ImageTransferTimeoutPolicy(Enum):
CANCEL = 'cancel'
LEGACY = 'legacy'
PAUSE = 'pause'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class InheritableBoolean(Enum):
FALSE = 'false'
INHERIT = 'inherit'
TRUE = 'true'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class IpVersion(Enum):
V4 = 'v4'
V6 = 'v6'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class JobStatus(Enum):
ABORTED = 'aborted'
FAILED = 'failed'
FINISHED = 'finished'
STARTED = 'started'
UNKNOWN = 'unknown'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class KdumpStatus(Enum):
DISABLED = 'disabled'
ENABLED = 'enabled'
UNKNOWN = 'unknown'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class LogMaxMemoryUsedThresholdType(Enum):
ABSOLUTE_VALUE_IN_MB = 'absolute_value_in_mb'
PERCENTAGE = 'percentage'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class LogSeverity(Enum):
ALERT = 'alert'
ERROR = 'error'
NORMAL = 'normal'
WARNING = 'warning'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class LunStatus(Enum):
FREE = 'free'
UNUSABLE = 'unusable'
USED = 'used'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class MessageBrokerType(Enum):
QPID = 'qpid'
RABBIT_MQ = 'rabbit_mq'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class MigrateOnError(Enum):
DO_NOT_MIGRATE = 'do_not_migrate'
MIGRATE = 'migrate'
MIGRATE_HIGHLY_AVAILABLE = 'migrate_highly_available'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class MigrationBandwidthAssignmentMethod(Enum):
AUTO = 'auto'
CUSTOM = 'custom'
HYPERVISOR_DEFAULT = 'hypervisor_default'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NetworkPluginType(Enum):
OPEN_VSWITCH = 'open_vswitch'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NetworkStatus(Enum):
NON_OPERATIONAL = 'non_operational'
OPERATIONAL = 'operational'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NetworkUsage(Enum):
DEFAULT_ROUTE = 'default_route'
DISPLAY = 'display'
GLUSTER = 'gluster'
MANAGEMENT = 'management'
MIGRATION = 'migration'
VM = 'vm'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NfsVersion(Enum):
AUTO = 'auto'
V3 = 'v3'
V4 = 'v4'
V4_0 = 'v4_0'
V4_1 = 'v4_1'
V4_2 = 'v4_2'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NicInterface(Enum):
E1000 = 'e1000'
E1000E = 'e1000e'
PCI_PASSTHROUGH = 'pci_passthrough'
RTL8139 = 'rtl8139'
RTL8139_VIRTIO = 'rtl8139_virtio'
SPAPR_VLAN = 'spapr_vlan'
VIRTIO = 'virtio'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NicStatus(Enum):
DOWN = 'down'
UP = 'up'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NotifiableEvent(Enum):
CLUSTER_ALERT_HA_RESERVATION = 'cluster_alert_ha_reservation'
CLUSTER_ALERT_HA_RESERVATION_DOWN = 'cluster_alert_ha_reservation_down'
DWH_ERROR = 'dwh_error'
DWH_STOPPED = 'dwh_stopped'
ENGINE_BACKUP_COMPLETED = 'engine_backup_completed'
ENGINE_BACKUP_FAILED = 'engine_backup_failed'
ENGINE_BACKUP_STARTED = 'engine_backup_started'
ENGINE_CA_CERTIFICATION_HAS_EXPIRED = 'engine_ca_certification_has_expired'
ENGINE_CA_CERTIFICATION_IS_ABOUT_TO_EXPIRE = 'engine_ca_certification_is_about_to_expire'
ENGINE_CERTIFICATION_HAS_EXPIRED = 'engine_certification_has_expired'
ENGINE_CERTIFICATION_IS_ABOUT_TO_EXPIRE = 'engine_certification_is_about_to_expire'
ENGINE_STOP = 'engine_stop'
FAULTY_MULTIPATHS_ON_HOST = 'faulty_multipaths_on_host'
GLUSTER_BRICK_STATUS_CHANGED = 'gluster_brick_status_changed'
GLUSTER_HOOK_ADD_FAILED = 'gluster_hook_add_failed'
GLUSTER_HOOK_ADDED = 'gluster_hook_added'
GLUSTER_HOOK_CONFLICT_DETECTED = 'gluster_hook_conflict_detected'
GLUSTER_HOOK_DETECTED_DELETE = 'gluster_hook_detected_delete'
GLUSTER_HOOK_DETECTED_NEW = 'gluster_hook_detected_new'
GLUSTER_HOOK_DISABLE = 'gluster_hook_disable'
GLUSTER_HOOK_DISABLE_FAILED = 'gluster_hook_disable_failed'
GLUSTER_HOOK_ENABLE = 'gluster_hook_enable'
GLUSTER_HOOK_ENABLE_FAILED = 'gluster_hook_enable_failed'
GLUSTER_HOOK_REMOVE_FAILED = 'gluster_hook_remove_failed'
GLUSTER_HOOK_REMOVED = 'gluster_hook_removed'
GLUSTER_SERVER_ADD_FAILED = 'gluster_server_add_failed'
GLUSTER_SERVER_REMOVE = 'gluster_server_remove'
GLUSTER_SERVER_REMOVE_FAILED = 'gluster_server_remove_failed'
GLUSTER_SERVICE_RESTART_FAILED = 'gluster_service_restart_failed'
GLUSTER_SERVICE_RESTARTED = 'gluster_service_restarted'
GLUSTER_SERVICE_START_FAILED = 'gluster_service_start_failed'
GLUSTER_SERVICE_STARTED = 'gluster_service_started'
GLUSTER_SERVICE_STOP_FAILED = 'gluster_service_stop_failed'
GLUSTER_SERVICE_STOPPED = 'gluster_service_stopped'
GLUSTER_VOLUME_ADD_BRICK = 'gluster_volume_add_brick'
GLUSTER_VOLUME_ADD_BRICK_FAILED = 'gluster_volume_add_brick_failed'
GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETE_FAILED = 'gluster_volume_all_snapshots_delete_failed'
GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETED = 'gluster_volume_all_snapshots_deleted'
GLUSTER_VOLUME_BRICK_REPLACED = 'gluster_volume_brick_replaced'
GLUSTER_VOLUME_CONFIRMED_SPACE_LOW = 'gluster_volume_confirmed_space_low'
GLUSTER_VOLUME_CREATE = 'gluster_volume_create'
GLUSTER_VOLUME_CREATE_FAILED = 'gluster_volume_create_failed'
GLUSTER_VOLUME_DELETE = 'gluster_volume_delete'
GLUSTER_VOLUME_DELETE_FAILED = 'gluster_volume_delete_failed'
GLUSTER_VOLUME_MIGRATE_BRICK_DATA_FINISHED = 'gluster_volume_migrate_brick_data_finished'
GLUSTER_VOLUME_OPTION_ADDED = 'gluster_volume_option_added'
GLUSTER_VOLUME_OPTION_MODIFIED = 'gluster_volume_option_modified'
GLUSTER_VOLUME_OPTION_SET_FAILED = 'gluster_volume_option_set_failed'
GLUSTER_VOLUME_OPTIONS_RESET = 'gluster_volume_options_reset'
GLUSTER_VOLUME_OPTIONS_RESET_ALL = 'gluster_volume_options_reset_all'
GLUSTER_VOLUME_OPTIONS_RESET_FAILED = 'gluster_volume_options_reset_failed'
GLUSTER_VOLUME_PROFILE_START = 'gluster_volume_profile_start'
GLUSTER_VOLUME_PROFILE_START_FAILED = 'gluster_volume_profile_start_failed'
GLUSTER_VOLUME_PROFILE_STOP = 'gluster_volume_profile_stop'
GLUSTER_VOLUME_PROFILE_STOP_FAILED = 'gluster_volume_profile_stop_failed'
GLUSTER_VOLUME_REBALANCE_FINISHED = 'gluster_volume_rebalance_finished'
GLUSTER_VOLUME_REBALANCE_NOT_FOUND_FROM_CLI = 'gluster_volume_rebalance_not_found_from_cli'
GLUSTER_VOLUME_REBALANCE_START = 'gluster_volume_rebalance_start'
GLUSTER_VOLUME_REBALANCE_START_DETECTED_FROM_CLI = 'gluster_volume_rebalance_start_detected_from_cli'
GLUSTER_VOLUME_REBALANCE_START_FAILED = 'gluster_volume_rebalance_start_failed'
GLUSTER_VOLUME_REBALANCE_STOP = 'gluster_volume_rebalance_stop'
GLUSTER_VOLUME_REBALANCE_STOP_FAILED = 'gluster_volume_rebalance_stop_failed'
GLUSTER_VOLUME_REMOVE_BRICKS = 'gluster_volume_remove_bricks'
GLUSTER_VOLUME_REMOVE_BRICKS_FAILED = 'gluster_volume_remove_bricks_failed'
GLUSTER_VOLUME_REMOVE_BRICKS_STOP = 'gluster_volume_remove_bricks_stop'
GLUSTER_VOLUME_REMOVE_BRICKS_STOP_FAILED = 'gluster_volume_remove_bricks_stop_failed'
GLUSTER_VOLUME_REPLACE_BRICK_FAILED = 'gluster_volume_replace_brick_failed'
GLUSTER_VOLUME_REPLACE_BRICK_START = 'gluster_volume_replace_brick_start'
GLUSTER_VOLUME_REPLACE_BRICK_START_FAILED = 'gluster_volume_replace_brick_start_failed'
GLUSTER_VOLUME_SNAPSHOT_ACTIVATE_FAILED = 'gluster_volume_snapshot_activate_failed'
GLUSTER_VOLUME_SNAPSHOT_ACTIVATED = 'gluster_volume_snapshot_activated'
GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED = 'gluster_volume_snapshot_create_failed'
GLUSTER_VOLUME_SNAPSHOT_CREATED = 'gluster_volume_snapshot_created'
GLUSTER_VOLUME_SNAPSHOT_DEACTIVATE_FAILED = 'gluster_volume_snapshot_deactivate_failed'
GLUSTER_VOLUME_SNAPSHOT_DEACTIVATED = 'gluster_volume_snapshot_deactivated'
GLUSTER_VOLUME_SNAPSHOT_DELETE_FAILED = 'gluster_volume_snapshot_delete_failed'
GLUSTER_VOLUME_SNAPSHOT_DELETED = 'gluster_volume_snapshot_deleted'
GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED = 'gluster_volume_snapshot_restore_failed'
GLUSTER_VOLUME_SNAPSHOT_RESTORED = 'gluster_volume_snapshot_restored'
GLUSTER_VOLUME_START = 'gluster_volume_start'
GLUSTER_VOLUME_START_FAILED = 'gluster_volume_start_failed'
GLUSTER_VOLUME_STOP = 'gluster_volume_stop'
GLUSTER_VOLUME_STOP_FAILED = 'gluster_volume_stop_failed'
HA_VM_FAILED = 'ha_vm_failed'
HA_VM_RESTART_FAILED = 'ha_vm_restart_failed'
HOST_ACTIVATE_FAILED = 'host_activate_failed'
HOST_ACTIVATE_MANUAL_HA = 'host_activate_manual_ha'
HOST_APPROVE_FAILED = 'host_approve_failed'
HOST_BOND_SLAVE_STATE_DOWN = 'host_bond_slave_state_down'
HOST_CERTIFICATE_HAS_INVALID_SAN = 'host_certificate_has_invalid_san'
HOST_CERTIFICATION_HAS_EXPIRED = 'host_certification_has_expired'
HOST_CERTIFICATION_IS_ABOUT_TO_EXPIRE = 'host_certification_is_about_to_expire'
HOST_FAILURE = 'host_failure'
HOST_HIGH_CPU_USE = 'host_high_cpu_use'
HOST_HIGH_MEM_USE = 'host_high_mem_use'
HOST_HIGH_SWAP_USE = 'host_high_swap_use'
HOST_INITIATED_RUN_VM_FAILED = 'host_initiated_run_vm_failed'
HOST_INSTALL_FAILED = 'host_install_failed'
HOST_INTERFACE_HIGH_NETWORK_USE = 'host_interface_high_network_use'
HOST_INTERFACE_STATE_DOWN = 'host_interface_state_down'
HOST_LOW_MEM = 'host_low_mem'
HOST_LOW_SWAP = 'host_low_swap'
HOST_RECOVER_FAILED = 'host_recover_failed'
HOST_SET_NONOPERATIONAL = 'host_set_nonoperational'
HOST_SET_NONOPERATIONAL_DOMAIN = 'host_set_nonoperational_domain'
HOST_SET_NONOPERATIONAL_IFACE_DOWN = 'host_set_nonoperational_iface_down'
HOST_SLOW_STORAGE_RESPONSE_TIME = 'host_slow_storage_response_time'
HOST_TIME_DRIFT_ALERT = 'host_time_drift_alert'
HOST_UNTRUSTED = 'host_untrusted'
HOST_UPDATES_ARE_AVAILABLE = 'host_updates_are_available'
HOST_UPDATES_ARE_AVAILABLE_WITH_PACKAGES = 'host_updates_are_available_with_packages'
IMPORTEXPORT_IMPORT_TEMPLATE_FROM_TRUSTED_TO_UNTRUSTED = 'importexport_import_template_from_trusted_to_untrusted'
IMPORTEXPORT_IMPORT_TEMPLATE_FROM_UNTRUSTED_TO_TRUSTED = 'importexport_import_template_from_untrusted_to_trusted'
IMPORTEXPORT_IMPORT_VM_FROM_TRUSTED_TO_UNTRUSTED = 'importexport_import_vm_from_trusted_to_untrusted'
IMPORTEXPORT_IMPORT_VM_FROM_UNTRUSTED_TO_TRUSTED = 'importexport_import_vm_from_untrusted_to_trusted'
IRS_CONFIRMED_DISK_SPACE_LOW = 'irs_confirmed_disk_space_low'
IRS_DISK_SPACE_LOW = 'irs_disk_space_low'
IRS_DISK_SPACE_LOW_ERROR = 'irs_disk_space_low_error'
IRS_FAILURE = 'irs_failure'
MAC_ADDRESS_IS_EXTERNAL = 'mac_address_is_external'
MULTIPATH_DEVICES_WITHOUT_VALID_PATHS_ON_HOST = 'multipath_devices_without_valid_paths_on_host'
NETWORK_UPDATE_DISPLAY_FOR_CLUSTER_WITH_ACTIVE_VM = 'network_update_display_for_cluster_with_active_vm'
NETWORK_UPDATE_DISPLAY_FOR_HOST_WITH_ACTIVE_VM = 'network_update_display_for_host_with_active_vm'
NO_FAULTY_MULTIPATHS_ON_HOST = 'no_faulty_multipaths_on_host'
NUMBER_OF_LVS_ON_STORAGE_DOMAIN_EXCEEDED_THRESHOLD = 'number_of_lvs_on_storage_domain_exceeded_threshold'
REMOVE_GLUSTER_VOLUME_BRICKS_NOT_FOUND_FROM_CLI = 'remove_gluster_volume_bricks_not_found_from_cli'
START_REMOVING_GLUSTER_VOLUME_BRICKS = 'start_removing_gluster_volume_bricks'
START_REMOVING_GLUSTER_VOLUME_BRICKS_DETECTED_FROM_CLI = 'start_removing_gluster_volume_bricks_detected_from_cli'
START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED = 'start_removing_gluster_volume_bricks_failed'
SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM = 'system_change_storage_pool_status_no_host_for_spm'
SYSTEM_DEACTIVATED_STORAGE_DOMAIN = 'system_deactivated_storage_domain'
USER_ADD_VM_FROM_TRUSTED_TO_UNTRUSTED = 'user_add_vm_from_trusted_to_untrusted'
USER_ADD_VM_FROM_UNTRUSTED_TO_TRUSTED = 'user_add_vm_from_untrusted_to_trusted'
USER_ADD_VM_TEMPLATE_FROM_TRUSTED_TO_UNTRUSTED = 'user_add_vm_template_from_trusted_to_untrusted'
USER_ADD_VM_TEMPLATE_FROM_UNTRUSTED_TO_TRUSTED = 'user_add_vm_template_from_untrusted_to_trusted'
USER_HOST_MAINTENANCE = 'user_host_maintenance'
USER_HOST_MAINTENANCE_MANUAL_HA = 'user_host_maintenance_manual_ha'
USER_HOST_MAINTENANCE_MIGRATION_FAILED = 'user_host_maintenance_migration_failed'
USER_UPDATE_VM_FROM_TRUSTED_TO_UNTRUSTED = 'user_update_vm_from_trusted_to_untrusted'
USER_UPDATE_VM_FROM_UNTRUSTED_TO_TRUSTED = 'user_update_vm_from_untrusted_to_trusted'
USER_UPDATE_VM_TEMPLATE_FROM_TRUSTED_TO_UNTRUSTED = 'user_update_vm_template_from_trusted_to_untrusted'
USER_UPDATE_VM_TEMPLATE_FROM_UNTRUSTED_TO_TRUSTED = 'user_update_vm_template_from_untrusted_to_trusted'
VM_CONSOLE_CONNECTED = 'vm_console_connected'
VM_CONSOLE_DISCONNECTED = 'vm_console_disconnected'
VM_DOWN_ERROR = 'vm_down_error'
VM_FAILURE = 'vm_failure'
VM_MIGRATION_FAILED = 'vm_migration_failed'
VM_MIGRATION_START = 'vm_migration_start'
VM_MIGRATION_TO_SERVER_FAILED = 'vm_migration_to_server_failed'
VM_NOT_RESPONDING = 'vm_not_responding'
VM_PAUSED = 'vm_paused'
VM_PAUSED_EIO = 'vm_paused_eio'
VM_PAUSED_ENOSPC = 'vm_paused_enospc'
VM_PAUSED_EPERM = 'vm_paused_eperm'
VM_PAUSED_ERROR = 'vm_paused_error'
VM_RECOVERED_FROM_PAUSE_ERROR = 'vm_recovered_from_pause_error'
VM_SET_TICKET = 'vm_set_ticket'
VM_STATUS_RESTORED = 'vm_status_restored'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NotificationMethod(Enum):
SMTP = 'smtp'
SNMP = 'snmp'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class NumaTuneMode(Enum):
INTERLEAVE = 'interleave'
PREFERRED = 'preferred'
STRICT = 'strict'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class OpenStackNetworkProviderType(Enum):
EXTERNAL = 'external'
NEUTRON = 'neutron'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class OpenstackVolumeAuthenticationKeyUsageType(Enum):
CEPH = 'ceph'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class OsType(Enum):
OTHER = 'other'
OTHER_LINUX = 'other_linux'
RHEL_3 = 'rhel_3'
RHEL_3X64 = 'rhel_3x64'
RHEL_4 = 'rhel_4'
RHEL_4X64 = 'rhel_4x64'
RHEL_5 = 'rhel_5'
RHEL_5X64 = 'rhel_5x64'
RHEL_6 = 'rhel_6'
RHEL_6X64 = 'rhel_6x64'
UNASSIGNED = 'unassigned'
WINDOWS_2003 = 'windows_2003'
WINDOWS_2003X64 = 'windows_2003x64'
WINDOWS_2008 = 'windows_2008'
WINDOWS_2008R2X64 = 'windows_2008r2x64'
WINDOWS_2008X64 = 'windows_2008x64'
WINDOWS_2012X64 = 'windows_2012x64'
WINDOWS_7 = 'windows_7'
WINDOWS_7X64 = 'windows_7x64'
WINDOWS_8 = 'windows_8'
WINDOWS_8X64 = 'windows_8x64'
WINDOWS_XP = 'windows_xp'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class PayloadEncoding(Enum):
BASE64 = 'base64'
PLAINTEXT = 'plaintext'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class PmProxyType(Enum):
CLUSTER = 'cluster'
DC = 'dc'
OTHER_DC = 'other_dc'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class PolicyUnitType(Enum):
FILTER = 'filter'
LOAD_BALANCING = 'load_balancing'
WEIGHT = 'weight'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class PowerManagementStatus(Enum):
OFF = 'off'
ON = 'on'
UNKNOWN = 'unknown'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class QcowVersion(Enum):
QCOW2_V2 = 'qcow2_v2'
QCOW2_V3 = 'qcow2_v3'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class QosType(Enum):
CPU = 'cpu'
HOSTNETWORK = 'hostnetwork'
NETWORK = 'network'
STORAGE = 'storage'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class QuotaModeType(Enum):
AUDIT = 'audit'
DISABLED = 'disabled'
ENABLED = 'enabled'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ReportedDeviceType(Enum):
NETWORK = 'network'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ResolutionType(Enum):
ADD = 'add'
COPY = 'copy'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class RngSource(Enum):
HWRNG = 'hwrng'
RANDOM = 'random'
URANDOM = 'urandom'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class RoleType(Enum):
ADMIN = 'admin'
USER = 'user'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ScsiGenericIO(Enum):
DISABLED = 'disabled'
FILTERED = 'filtered'
UNFILTERED = 'unfiltered'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SeLinuxMode(Enum):
DISABLED = 'disabled'
ENFORCING = 'enforcing'
PERMISSIVE = 'permissive'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SerialNumberPolicy(Enum):
CUSTOM = 'custom'
HOST = 'host'
NONE = 'none'
VM = 'vm'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SnapshotStatus(Enum):
IN_PREVIEW = 'in_preview'
LOCKED = 'locked'
OK = 'ok'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SnapshotType(Enum):
ACTIVE = 'active'
PREVIEW = 'preview'
REGULAR = 'regular'
STATELESS = 'stateless'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SpmStatus(Enum):
CONTENDING = 'contending'
NONE = 'none'
SPM = 'spm'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SshAuthenticationMethod(Enum):
PASSWORD = 'password'
PUBLICKEY = 'publickey'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SsoMethod(Enum):
GUEST_AGENT = 'guest_agent'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StatisticKind(Enum):
COUNTER = 'counter'
GAUGE = 'gauge'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StatisticUnit(Enum):
BITS_PER_SECOND = 'bits_per_second'
BYTES = 'bytes'
BYTES_PER_SECOND = 'bytes_per_second'
COUNT_PER_SECOND = 'count_per_second'
NONE = 'none'
PERCENT = 'percent'
SECONDS = 'seconds'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StepEnum(Enum):
EXECUTING = 'executing'
FINALIZING = 'finalizing'
REBALANCING_VOLUME = 'rebalancing_volume'
REMOVING_BRICKS = 'removing_bricks'
UNKNOWN = 'unknown'
VALIDATING = 'validating'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StepStatus(Enum):
ABORTED = 'aborted'
FAILED = 'failed'
FINISHED = 'finished'
STARTED = 'started'
UNKNOWN = 'unknown'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StorageDomainStatus(Enum):
ACTIVATING = 'activating'
ACTIVE = 'active'
DETACHING = 'detaching'
INACTIVE = 'inactive'
LOCKED = 'locked'
MAINTENANCE = 'maintenance'
MIXED = 'mixed'
PREPARING_FOR_MAINTENANCE = 'preparing_for_maintenance'
UNATTACHED = 'unattached'
UNKNOWN = 'unknown'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StorageDomainType(Enum):
DATA = 'data'
EXPORT = 'export'
IMAGE = 'image'
ISO = 'iso'
MANAGED_BLOCK_STORAGE = 'managed_block_storage'
VOLUME = 'volume'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StorageFormat(Enum):
V1 = 'v1'
V2 = 'v2'
V3 = 'v3'
V4 = 'v4'
V5 = 'v5'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class StorageType(Enum):
CINDER = 'cinder'
FCP = 'fcp'
GLANCE = 'glance'
GLUSTERFS = 'glusterfs'
ISCSI = 'iscsi'
LOCALFS = 'localfs'
MANAGED_BLOCK_STORAGE = 'managed_block_storage'
NFS = 'nfs'
POSIXFS = 'posixfs'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class SwitchType(Enum):
LEGACY = 'legacy'
OVS = 'ovs'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class TemplateStatus(Enum):
ILLEGAL = 'illegal'
LOCKED = 'locked'
OK = 'ok'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class TransportType(Enum):
RDMA = 'rdma'
TCP = 'tcp'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class UsbType(Enum):
LEGACY = 'legacy'
NATIVE = 'native'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class ValueType(Enum):
DECIMAL = 'decimal'
INTEGER = 'integer'
STRING = 'string'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VgpuPlacement(Enum):
CONSOLIDATED = 'consolidated'
SEPARATED = 'separated'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VmAffinity(Enum):
MIGRATABLE = 'migratable'
PINNED = 'pinned'
USER_MIGRATABLE = 'user_migratable'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VmDeviceType(Enum):
CDROM = 'cdrom'
FLOPPY = 'floppy'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VmPoolType(Enum):
AUTOMATIC = 'automatic'
MANUAL = 'manual'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VmStatus(Enum):
DOWN = 'down'
IMAGE_LOCKED = 'image_locked'
MIGRATING = 'migrating'
NOT_RESPONDING = 'not_responding'
PAUSED = 'paused'
POWERING_DOWN = 'powering_down'
POWERING_UP = 'powering_up'
REBOOT_IN_PROGRESS = 'reboot_in_progress'
RESTORING_STATE = 'restoring_state'
SAVING_STATE = 'saving_state'
SUSPENDED = 'suspended'
UNASSIGNED = 'unassigned'
UNKNOWN = 'unknown'
UP = 'up'
WAIT_FOR_LAUNCH = 'wait_for_launch'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VmStorageErrorResumeBehaviour(Enum):
AUTO_RESUME = 'auto_resume'
KILL = 'kill'
LEAVE_PAUSED = 'leave_paused'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VmType(Enum):
DESKTOP = 'desktop'
HIGH_PERFORMANCE = 'high_performance'
SERVER = 'server'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class VnicPassThroughMode(Enum):
DISABLED = 'disabled'
ENABLED = 'enabled'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class WatchdogAction(Enum):
DUMP = 'dump'
NONE = 'none'
PAUSE = 'pause'
POWEROFF = 'poweroff'
RESET = 'reset'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
@unique
class WatchdogModel(Enum):
DIAG288 = 'diag288'
I6300ESB = 'i6300esb'
def __init__(self, image):
self._image = image
def __str__(self):
return self._image
| 24.006894 | 117 | 0.574781 |
e95e7dbd4389a897ceba5e7e0489f685491ba2e1 | 4,537 | lua | Lua | addons/death-marker.lua | hidden-relic/OARC_hidden_relic_WIP | 8dd725018b15d6c882514ba8279e1605643f52a3 | [
"MIT"
] | null | null | null | addons/death-marker.lua | hidden-relic/OARC_hidden_relic_WIP | 8dd725018b15d6c882514ba8279e1605643f52a3 | [
"MIT"
] | null | null | null | addons/death-marker.lua | hidden-relic/OARC_hidden_relic_WIP | 8dd725018b15d6c882514ba8279e1605643f52a3 | [
"MIT"
] | null | null | null | --[[
Copyright 2017-2018 "Kovus" <kovus@soulless.wtf>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
death_marker.lua - Create a death marker at player death location.
@usage require('modules/common/deathmarker')
--]]
deathmarkers = {}
function deathmarkers.init(event)
if not global.death_markers then
global.death_markers = {
counters = {},
markers = {}
}
end
end
function removeCorpseTag(entity)
local player = game.players[entity.character_corpse_player_index]
if not player then
return
end
local tick = entity.character_corpse_tick_of_death
local markers = global.death_markers.markers
for idx = 1, #markers do
local entry = markers[idx]
if entry and entry.player_index == player.index and entry.death_tick == tick then
if entry.tag and entry.tag.valid then
if player.connected then
player.print({'death_marker.removed', entry.tag.text})
end
entry.tag.destroy()
end
table.remove(markers, idx)
return
end
end
end
function deathmarkers.playerDied(event)
local plidx = event.player_index
local player = game.players[plidx]
local position = player.position
local surface = player.surface
local force = player.force
local counters = global.death_markers.counters
if counters[plidx] then
counters[plidx] = counters[plidx] + 1
else
counters[plidx] = 1
end
-- cannot localize the marker text, as it's a map entity common to all
-- players, and not a gui element or player-based output message.
local text = table.concat({'RIP ', player.name, ' (', counters[plidx], ')'})
local tag =
force.add_chart_tag(
surface,
{
position = position,
text = text,
icon = {type = 'item', name = 'power-armor-mk2'}
}
)
table.insert(
global.death_markers.markers,
{
tag = tag,
player_index = plidx,
death_tick = event.tick
}
)
for index, cplayer in pairs(player.force.connected_players) do
if cplayer.surface == surface then
cplayer.print({'death_marker.message', player.name, text, position.x, position.y})
end
end
end
function deathmarkers.corpseExpired(event)
removeCorpseTag(event.corpse)
end
function deathmarkers.onMined(event)
if event.entity.valid and event.entity.name == 'character-corpse' then
removeCorpseTag(event.entity)
end
end
-- typically, this is part of a softmod pack, so let's just assume we got
-- dropped into an existing save, and init on first player join/create
Event.register(defines.events.on_player_joined_game, deathmarkers.init)
Event.register(defines.events.on_player_created, deathmarkers.init)
Event.register(defines.events.on_pre_player_died, deathmarkers.playerDied)
Event.register(defines.events.on_character_corpse_expired, deathmarkers.corpseExpired)
Event.register(defines.events.on_pre_player_mined_item, deathmarkers.onMined)
| 36.007937 | 94 | 0.708398 |
5733856081210d8974b7b873850ea6519110aa16 | 6,209 | kt | Kotlin | app/src/main/java/de/p72b/geo/demo/showcase/MainViewModel.kt | P72B/geo-library | 38818f5fbc43ff4cc2502e0d3fde495c11bfbb75 | [
"MIT"
] | 4 | 2020-07-02T09:03:36.000Z | 2021-02-11T14:50:45.000Z | app/src/main/java/de/p72b/geo/demo/showcase/MainViewModel.kt | P72B/geo-library | 38818f5fbc43ff4cc2502e0d3fde495c11bfbb75 | [
"MIT"
] | null | null | null | app/src/main/java/de/p72b/geo/demo/showcase/MainViewModel.kt | P72B/geo-library | 38818f5fbc43ff4cc2502e0d3fde495c11bfbb75 | [
"MIT"
] | null | null | null | package de.p72b.geo.demo.showcase
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.MutableLiveData
import com.google.android.gms.maps.model.LatLng
import de.p72b.geo.demo.usecase.*
import de.p72b.geo.demo.util.BaseViewModel
import de.p72b.geo.demo.util.ConverterHelper
import de.p72b.geo.google.DirectionsRoute
import de.p72b.geo.util.UnitLocale
import io.reactivex.Scheduler
import io.reactivex.rxkotlin.subscribeBy
class MainViewModel(
private val mainThread: Scheduler,
private val networkThread: Scheduler,
private val osrmDrivingDirectionsUseCase: OsrmDrivingDirectionsUseCase,
private val osrmWalkingDirectionsUseCase: OsrmWalkingDirectionsUseCase,
private val googleDrivingDirectionsUseCase: GoogleDrivingDirectionsUseCase,
private val googleWalkingDirectionsUseCase: GoogleWalkingDirectionsUseCase
) : BaseViewModel(), LifecycleObserver {
companion object {
private const val CACHE_BOX_HIT_SIZE_DEFAULT = 12
private const val GOOGLE_SERVICE_ID = "google"
private const val OSRM_SERVICE_ID = "osrm"
val originDefault = LatLng(52.5329704, 13.3832851)
val destinationDefault = LatLng(52.5076062, 13.3646353)
}
val origin = MutableLiveData<String>()
.apply { postValue(ConverterHelper.latLngToString(originDefault)) }
val destination = MutableLiveData<String>()
.apply { postValue(ConverterHelper.latLngToString(destinationDefault)) }
val boxHitCacheSizeInMeters = MutableLiveData<String>()
.apply { postValue(CACHE_BOX_HIT_SIZE_DEFAULT.toString()) }
val osrmTripSummary = MutableLiveData<String>()
val googleTripSummary = MutableLiveData<String>()
val osrmRoute = MutableLiveData<Pair<String, List<LatLng>>>()
val googleRoute = MutableLiveData<Pair<String, List<LatLng>>>()
val progressActive = MutableLiveData<Boolean>()
.apply { postValue(false) }
private var onFinallyCount = 0
fun onWalkingRouteClicked() {
if (!isInputValid()) return
calculateWalkingRoute(
ConverterHelper.stringToLatLng(origin.value!!),
ConverterHelper.stringToLatLng(destination.value!!),
Integer.parseInt(boxHitCacheSizeInMeters.value!!)
)
}
fun onDrivingRouteClicked() {
if (!isInputValid()) return
calculateDrivingRoute(
ConverterHelper.stringToLatLng(origin.value!!),
ConverterHelper.stringToLatLng(destination.value!!),
Integer.parseInt(boxHitCacheSizeInMeters.value!!)
)
}
fun cacheHitBoxSizeChanged(value: String) {
boxHitCacheSizeInMeters.postValue(value)
}
fun originChanged(value: String) {
origin.postValue(value)
}
fun destinationChanged(value: String) {
destination.postValue(value)
}
private fun isInputValid(): Boolean {
if (origin.value.isNullOrEmpty()) return false
if (destination.value.isNullOrEmpty()) return false
if (boxHitCacheSizeInMeters.value == null) return false
return true
}
private fun calculateWalkingRoute(origin: LatLng, destination: LatLng, cacheHitSize: Int) {
progressActive.postValue(true)
callDirections(
osrmWalkingDirectionsUseCase,
origin,
destination,
cacheHitSize,
OSRM_SERVICE_ID,
osrmTripSummary,
osrmRoute
)
callDirections(
googleWalkingDirectionsUseCase,
origin,
destination,
cacheHitSize,
GOOGLE_SERVICE_ID,
googleTripSummary,
googleRoute
)
}
private fun calculateDrivingRoute(origin: LatLng, destination: LatLng, cacheHitSize: Int) {
progressActive.postValue(true)
callDirections(
osrmDrivingDirectionsUseCase,
origin,
destination,
cacheHitSize,
OSRM_SERVICE_ID,
osrmTripSummary,
osrmRoute
)
callDirections(
googleDrivingDirectionsUseCase,
origin,
destination,
cacheHitSize,
GOOGLE_SERVICE_ID,
googleTripSummary,
googleRoute
)
}
private fun callDirections(
useCase: DirectionsUseCase,
origin: LatLng,
destination: LatLng,
cacheHitSize: Int,
serviceResultName: String,
summary: MutableLiveData<String>,
route: MutableLiveData<Pair<String, List<LatLng>>>
) {
useCase.invoke(origin, destination, cacheHitSize, cacheHitSize)
.subscribeOn(networkThread)
.observeOn(mainThread)
.doFinally {
doOnFinally()
}
.subscribeBy(
onError = {
System.out.println("ERROR $it")
},
onSuccess = {
handleDirectionsResult(serviceResultName, it, summary, route)
}
).autoDispose()
}
private fun doOnFinally() {
onFinallyCount++
if (onFinallyCount < 2) return
onFinallyCount = 0
progressActive.postValue(false)
}
private fun handleDirectionsResult(
serviceResultName: String,
result: DirectionsRoute?,
summary: MutableLiveData<String>,
route: MutableLiveData<Pair<String, List<LatLng>>>
) {
result?.let { directionsRoute ->
directionsRoute.polyLine?.let {
if (route.value?.first != it.points) {
route.postValue(Pair(it.points, it.decodePath()))
}
}
val distance = directionsRoute.getDistance?.inMeters ?: 0L
val duration = directionsRoute.getDuration?.inSeconds ?: 0L
if (distance > 0L && duration > 0L) {
summary.postValue(
"$serviceResultName: ${duration / 60} Min. (${UnitLocale.default.fromMeters(
distance
)})"
)
} else {
summary.postValue("")
}
}
}
} | 33.562162 | 96 | 0.62506 |
596cc5d1dc897ef2f8baa65f80c8a448f4a7a997 | 1,012 | sql | SQL | Four2One/Four2One/Scripts/VersionUpdate/v205/16_getPatientVitals.sql | kccb-karp/IQCareMigration | df35dc31e47d3f84cb09a541e22fbe071f4fe995 | [
"Apache-2.0"
] | null | null | null | Four2One/Four2One/Scripts/VersionUpdate/v205/16_getPatientVitals.sql | kccb-karp/IQCareMigration | df35dc31e47d3f84cb09a541e22fbe071f4fe995 | [
"Apache-2.0"
] | 14 | 2018-06-13T09:55:38.000Z | 2018-07-21T15:32:00.000Z | Four2One/Four2One/Scripts/VersionUpdate/v205/16_getPatientVitals.sql | kccb-karp/IQCareMigration | df35dc31e47d3f84cb09a541e22fbe071f4fe995 | [
"Apache-2.0"
] | 1 | 2019-07-05T05:52:22.000Z | 2019-07-05T05:52:22.000Z | IF EXISTS (SELECT * FROM sys.objects WHERE object_id
= OBJECT_ID(N'[dbo].[getPatientVitals]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].getPatientVitals
GO
CREATE PROCEDURE [dbo].[getPatientVitals]
(
@PatientMasterVisitID int, @PatientID INT
)
AS
BEGIN
SELECT distinct
PatientId
, cast(visitdate as date) VisitDate
, Case when Height <= 0 then NULL ELSE Height end as Height
, CASE WHEN [Weight] <=0 THEN NULL ELSE [Weight] END AS [Weight]
, CASE WHEN Muac <=0 THEN NULL ELSE Muac END AS Muac
, CASE WHEN BPSystolic <=0 THEN NULL ELSE BPSystolic END AS BPSystolic
, CASE WHEN BPDiastolic <=0 THEN NULL ELSE BPDiastolic END AS BPDiastolic
, CASE WHEN Temperature <=0 THEN NULL ELSE Temperature END AS Temperature
, CASE WHEN HeartRate <=0 THEN NULL ELSE HeartRate END AS HeartRate
, CASE WHEN RespiratoryRate <=0 THEN NULL ELSE RespiratoryRate END AS RespiratoryRate
, CASE WHEN SpO2 <=0 THEN NULL ELSE SpO2 END AS SpO2
FROM PatientVitals
WHERE Patientid = @PatientID
order by VisitDate desc
END
GO
| 31.625 | 85 | 0.763834 |
41c055935fe0e82e4a6afa358593cd399b63290f | 3,428 | kt | Kotlin | modules/editing/src/main/kotlin/silentorb/mythic/editing/updating/UpdateCamera.kt | silentorb/mythic-kotlin | 74462fcba9e7805dddec1bfcb3431665df7d0dee | [
"MIT"
] | 1 | 2020-06-24T02:01:23.000Z | 2020-06-24T02:01:23.000Z | modules/editing/src/main/kotlin/silentorb/mythic/editing/updating/UpdateCamera.kt | silentorb/mythic-kotlin | 74462fcba9e7805dddec1bfcb3431665df7d0dee | [
"MIT"
] | 5 | 2019-12-24T17:14:43.000Z | 2021-01-26T22:33:47.000Z | modules/editing/src/main/kotlin/silentorb/mythic/editing/updating/UpdateCamera.kt | silentorb/mythic-kotlin | 74462fcba9e7805dddec1bfcb3431665df7d0dee | [
"MIT"
] | null | null | null | package silentorb.mythic.editing.updating
import silentorb.mythic.editing.general.MouseState
import silentorb.mythic.editing.main.*
import silentorb.mythic.editing.panels.defaultViewportId
import silentorb.mythic.ent.scenery.getAbsoluteNodeTransform
import silentorb.mythic.happenings.Command
import silentorb.mythic.scenery.ProjectionType
import silentorb.mythic.spatial.*
fun applyCameraPreset(camera: CameraRig, lookat: Vector3): CameraRig {
val pivot = getCameraPivot(camera)
val location = pivot - lookat * camera.pivotDistance
val rotation = getYawAndPitch(lookat)
return camera.copy(
location = location,
rotation = rotation,
)
}
fun toggleProjectionMode(camera: CameraRig): CameraRig =
camera.copy(
projection = if (camera.projection == ProjectionType.perspective)
ProjectionType.orthographic
else
ProjectionType.perspective
)
fun centerOnSelection(editor: Editor, camera: CameraRig): CameraRig {
val selection = getNodeSelection(editor)
val graph = getTransformedActiveEditorGraph(editor)
return if (selection.any() && graph != null) {
val nodeLocation = getAbsoluteNodeTransform(graph, selection.first()).translation()
val pivot = getCameraPivot(camera)
val pivotToCameraOffset = camera.location - pivot
val nextLocation = nodeLocation + pivotToCameraOffset
camera.copy(
location = nextLocation
)
} else
camera
}
fun applyCameraPresets(editor: Editor, commandType: Any, camera: CameraRig): CameraRig? {
return when (commandType) {
EditorCommands.viewFront -> applyCameraPreset(camera, Vector3(0f, 1f, 0f))
EditorCommands.viewBack -> applyCameraPreset(camera, Vector3(0f, -1f, 0f))
EditorCommands.viewRight -> applyCameraPreset(camera, Vector3(-1f, 0f, 0f))
EditorCommands.viewLeft -> applyCameraPreset(camera, Vector3(1f, 0f, 0f))
EditorCommands.viewTop -> applyCameraPreset(camera, Vector3(0f, 0f, -1f))
EditorCommands.viewBottom -> applyCameraPreset(camera, Vector3(0f, 0f, 1f))
EditorCommands.centerOnSelection -> centerOnSelection(editor, camera)
EditorCommands.toggleProjectionMode -> toggleProjectionMode(camera)
else -> null
}
}
fun applyCameraPresets(editor: Editor, commands: List<Command>, camera: CameraRig): CameraRig? =
commands
.mapNotNull { applyCameraPresets(editor, it.type, camera) }
.firstOrNull()
fun updateCameraMouseAction(mouseAction: MouseAction, mouseOffset: Vector2, camera: CameraRig): CameraRig =
when (mouseAction) {
MouseAction.pan -> updateCameraPanning(mouseOffset, camera)
MouseAction.orbit -> updateCameraOrbiting(mouseOffset, camera)
else -> camera
}
fun updateCamera(editor: Editor, mouse: MouseState, commands: List<Command>, viewport: String, camera: CameraRig): CameraRig {
val isInBounds = isInViewportBounds(editor, mouse.position, viewport)
val lookOffset = if (editor.flyThrough && mouse.offset != Vector2.zero)
-mouse.offset * 4f / (editor.viewportBoundsMap[defaultViewportId]?.zw()?.toVector2() ?: Vector2.zero)
else
Vector2.zero
return applyCameraPresets(editor, commands, camera)
?: if (editor.mouseAction != MouseAction.none && editor.mouseActionViewport == viewport)
updateCameraMouseAction(editor.mouseAction, mouse.offset, camera)
else
updateFlyThroughCamera(mouse.offset, commands, camera, isInBounds, lookOffset)
}
| 40.809524 | 126 | 0.745333 |
6bf4fcd396726b10b2e4a602740d923cd048b649 | 1,348 | lua | Lua | boilerplate.lua | ccheever/zcao | ba454cb6baabe6f64578a33ad29c37501f089ae5 | [
"MIT"
] | 1 | 2020-10-09T13:14:42.000Z | 2020-10-09T13:14:42.000Z | boilerplate.lua | ccheever/zcao | ba454cb6baabe6f64578a33ad29c37501f089ae5 | [
"MIT"
] | null | null | null | boilerplate.lua | ccheever/zcao | ba454cb6baabe6f64578a33ad29c37501f089ae5 | [
"MIT"
] | null | null | null | local powerMultipliers = {
[2] = function(a)
return a * a
end,
[3] = function(a)
return a * a * a
end,
[4] = function(a)
return a * a * a * a
end,
[5] = function(a)
return a * a * a * a * a
end
}
return {
tau = math.pi * 2,
lerp = function(a, b, t)
return (b - a) * t + a
end,
-- In JS, % is not modulus but remainder
-- In LuaJIT, it's modulus though
-- See https://rob.conery.io/2018/08/21/mod-and-remainder-are-not-the-same/
modulo = function(num, div)
return (num % div)
-- return ((num % div) + div) % div,
end,
powerMultipliers = powerMultipliers,
easeInOut = function(alpha, power)
if (power == 1) then
return alpha
end
alpha = math.max(0, math.min(1, alpha))
local isFirstHalf = alpha < 0.5
local slope
if isFirstHalf then
slope = alpha
else
slope = 1 - alpha
end
slope = slope / 0.5
-- Make easing steeper with more multiples
local powerMultiplier = powerMultipliers[power] or powerMultipliers[2]
local curve = powerMultiplier(slope)
curve = curve / 2
if isFirstHalf then
return curve
else
return 1 - curve
end
end
}
| 24.962963 | 79 | 0.52003 |
76ec645417d5d523515b1c1c9bf4e43986b951c3 | 233 | sql | SQL | lib/db/orig/charttimes.sql | CodeRancher/offcenter_trading | 68526fdc0f27d611f748b2fa20f49e743d3ee5eb | [
"Apache-2.0"
] | null | null | null | lib/db/orig/charttimes.sql | CodeRancher/offcenter_trading | 68526fdc0f27d611f748b2fa20f49e743d3ee5eb | [
"Apache-2.0"
] | 4 | 2021-12-27T17:56:21.000Z | 2022-01-05T00:05:01.000Z | lib/db/orig/charttimes.sql | CodeRancher/offcenter_trading | 68526fdc0f27d611f748b2fa20f49e743d3ee5eb | [
"Apache-2.0"
] | null | null | null | USE jody;
CREATE TABLE ChartTimes (
Name varchar(30) NOT NULL,
HTF varchar(10) NOT NULL,
HTFMinutes int,
ITF varchar(10) NOT NULL,
ITFMinutes int,
STF varchar(10) NOT NULL,
STFMinutes int,
PRIMARY KEY (Name) USING BTREE
)
| 16.642857 | 31 | 0.72103 |
cb58ac7e6e2235d5fd92ab6e82337b78be0dc0a9 | 11,666 | html | HTML | assets/js/app/routes/partials/form-route-015.html | xiaojun207/konga | f13bf7268bae3988fc1b8a9c62d1d2504f6863a2 | [
"MIT"
] | null | null | null | assets/js/app/routes/partials/form-route-015.html | xiaojun207/konga | f13bf7268bae3988fc1b8a9c62d1d2504f6863a2 | [
"MIT"
] | null | null | null | assets/js/app/routes/partials/form-route-015.html | xiaojun207/konga | f13bf7268bae3988fc1b8a9c62d1d2504f6863a2 | [
"MIT"
] | null | null | null | <div class="col col-sm-offset-3">
<div class="alert alert-info">
<small
>* For hosts, paths, methods and protocols, snis, sources, headers and destinations
press enter to apply every value you type</small
>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.name}">
<label class="col-sm-3 control-label"
>Name <br /><em><small class="help-block">{{__('optional')}}</small></em></label
>
<div class="col-sm-9">
<input ng-model="route.name" class="form-control" />
<div
class="text-danger"
ng-if="errors.name"
data-ng-bind="errors.name"
></div>
<p class="help-block">
The name of the Route.
</p>
</div>
</div>
<div class="form-group" ng-if="isGatewayVersionEqOrGreater('1.1.0-rc1')">
<label class="col-sm-3 control-label"
>Tags <br /><em><small class="help-block">{{__('optional')}}</small></em></label
>
<div class="col-sm-9">
<chips ng-model="route.tags">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input
ng-model-control
data-ng-keypress="onTagInputKeyPress($event)"
ng-model="$tag"
uib-typeahead="tag for tag in tags | filter:$viewValue | limitTo:10"
/>
</chips>
<p class="help-block">
Optionally add tags to the route
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.hosts}">
<label class="col-sm-3 control-label"
>Hosts <br /><em><small class="help-block">{{ __('semi-optional')}}</small></em></label
>
<div class="col-sm-9">
<chips ng-model="route.hosts">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<!--<input ng-model="route.hosts" class="form-control">-->
<div
class="text-danger"
ng-if="errors.hosts"
data-ng-bind="errors.hosts"
></div>
<p class="help-block">
A list of domain names that match this Route. For example: example.com. At
least one of hosts, paths, or methods must be set.
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.paths}">
<label class="col-sm-3 control-label"
>Paths <br /><em><small class="help-block">{{ __('semi-optional')}}</small></em></label
>
<div class="col-sm-9">
<chips ng-model="route.paths">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<p class="help-block">
A list of paths that match this Route. For example: /my-path. At least one
of <code>hosts</code>, <code>paths</code>, or <code>methods</code> must be
set.
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.headers}">
<label class="col-sm-3 control-label"
>Headers <br /><em
><small class="help-block">{{ __('semi-optional')}}</small></em
></label
>
<div class="col-sm-9">
<chips ng-model="route.headers">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<p class="help-block">
One or more lists of values indexed by header name that will cause this
Route to match if present in the request. The <code>Host</code> header cannot be used
with this attribute: hosts should be specified using the <code>hosts</code> attribute.<br>
<code>Field values format example: x-some-header:foo,bar</code>
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.path_handling}" ng-if="route.path_handling">
<label class="col-sm-3 control-label">Path handling</label>
<div class="col-sm-9">
<select
ng-model="route.path_handling"
class="form-control pull-right"
ng-options="item for item in ['v0', 'v1']"
>
</select>
<p class="help-block">
Controls how the Service path, Route path and requested path are combined
when sending a request to the upstream. See above for a detailed
description of each behavior. Accepted values are: <code>"v0"</code>, <code>"v1"</code>. Defaults to
<code>"v1"</code>.
</p>
</div>
</div>
<div
class="form-group"
ng-class="{'has-error' : errors.https_redirect_status_code}"
>
<label class="col-sm-3 control-label"
>Https redirect status code <br /><em
><small class="help-block">{{__('optional')}}</small></em
></label
>
<div class="col-sm-9">
<input
type="number"
class="form-control"
ng-model="route.https_redirect_status_code"
/>
<p class="help-block">
The status code Kong responds with when all properties of a Route match
except the protocol, i.e. if the protocol of the request is
<code>HTTP</code> instead of <code>HTTPS</code>.
<code>Location</code> header is injected by Kong if the field is set to
301, 302, 307 or 308. Defaults to <code>426</code>.
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.regex_priority}">
<label class="col-sm-3 control-label"
>Regex priority <br /><em
><small class="help-block">{{__('optional')}}</small></em
></label
>
<div class="col-sm-9">
<input type="number" class="form-control" ng-model="route.regex_priority" />
<p class="help-block">
A number used to choose which route resolves a given request when several
routes match it using regexes simultaneously. When two routes match the
path and have the same <code>regex_priority</code>, the older one (lowest
<code>created_at</code>) is used. Note that the priority for non-regex
routes is different (longer non-regex routes are matched before shorter
ones). Defaults to <code>0</code>.
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.methods}">
<label class="col-sm-3 control-label"
>Methods <br /><em
><small class="help-block">{{ __('semi-optional')}}</small></em
></label
>
<div class="col-sm-9">
<chips ng-model="route.methods">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<p class="help-block">
A list of HTTP methods that match this Route. At least one of
<code>hosts</code>, <code>paths</code>, or <code>methods</code> must be
set.
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"
>Strip Path <br /><em><small class="help-block">{{__('optional')}}</small></em></label
>
<div class="col-sm-9">
<input
bs-switch
ng-model="route.strip_path"
switch-size="small"
type="checkbox"
switch-on-text="YES"
switch-off-text="NO"
/>
<p class="help-block">
When matching a Route via one of the <code>paths</code>, strip the
matching prefix from the upstream request URL.
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"
>{{__('Preserve Host')}} <br /><em
><small class="help-block">{{__('optional')}}</small></em
></label
>
<div class="col-sm-9">
<input
bs-switch
ng-model="route.preserve_host"
switch-size="small"
type="checkbox"
switch-on-text="YES"
switch-off-text="NO"
/>
<p class="help-block">
When matching a Route via one of the <code>hosts</code> domain names, use
the request <code>Host</code> header in the upstream request headers. By
default set to <code>false</code>, and the upstream Host header will be
that of the Service's <code>host</code>
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.protocols}">
<label class="col-sm-3 control-label"
>Protocols <br /><em
><small class="help-block">{{ __('semi-optional')}}</small></em
></label
>
<div class="col-sm-9">
<chips ng-model="route.protocols">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<p class="help-block">
A list of the protocols this Route should allow. By default it is
<code>["http", "https"]</code>, which means that the Route accepts both.
When set to <code>["https"]</code>, HTTP requests are answered with a
request to upgrade to HTTPS.
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.snis}">
<label class="col-sm-3 control-label"
>SNIs <br /><em><small class="help-block">{{ __('semi-optional')}}</small></em></label
>
<div class="col-sm-9">
<chips ng-model="route.snis">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<p class="help-block">
A list of SNIs that match this Route when using stream routing. When using
<code>tcp</code> or <code>tls</code> protocols, at least one of
<code>snis</code>, <code>sources</code>, or <code>destinations</code> must
be set.
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.sources}">
<label class="col-sm-3 control-label"
>Sources <br /><em
><small class="help-block">{{ __('semi-optional')}}</small></em
></label
>
<div class="col-sm-9">
<chips ng-model="route.sources">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<p class="help-block">
A list of IP sources of incoming connections that match this Route when
using stream routing. Each entry is an object with fields “ip” (optionally
in CIDR range notation) and/or “port”. When using <code>tcp</code> or
<code>tls</code> protocols, at least one of <code>snis</code>,
<code>sources</code>, or <code>destinations</code> must be set.
<br />
<code
>The field expects values with ip:port format. ex:
192.168.1.2:3000</code
>
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.destinations}">
<label class="col-sm-3 control-label"
>Destinations <br /><em
><small class="help-block">{{ __('semi-optional')}}</small></em
></label
>
<div class="col-sm-9">
<chips ng-model="route.destinations">
<chip-tmpl>
<div class="default-chip">
{{chip}}
<i class="mdi mdi-close" remove-chip></i>
</div>
</chip-tmpl>
<input chip-control />
</chips>
<p class="help-block">
A list of IP destinations of incoming connections that match this Route
when using stream routing. Each entry is an object with fields “ip”
(optionally in CIDR range notation) and/or “port”. When using
<code>tcp</code> or <code>tls</code> protocols, at least one of
<code>snis</code>, <code>sources</code>, or <code>destinations</code> must
be set.
<br />
<code
>The field expects values with ip:port format. ex:
192.168.1.2:3000</code
>
</p>
</div>
</div>
| 32.861972 | 106 | 0.593348 |
c640a07b173a3fdce37328819ac37bfbcdc2918c | 21 | rb | Ruby | axle/lib/axle/rails.rb | cheokman/code_lab_2016 | 2fb152734d98ed6a904562e038d4ea7257375305 | [
"MIT"
] | null | null | null | axle/lib/axle/rails.rb | cheokman/code_lab_2016 | 2fb152734d98ed6a904562e038d4ea7257375305 | [
"MIT"
] | null | null | null | axle/lib/axle/rails.rb | cheokman/code_lab_2016 | 2fb152734d98ed6a904562e038d4ea7257375305 | [
"MIT"
] | null | null | null | require 'axle/engine' | 21 | 21 | 0.809524 |
0ba620be4d73b92a7785647ce66d121461107963 | 2,169 | js | JavaScript | src/pages/publisher/nft-create-rights.js | KrisMit/vine-dev-static | c60d15f9b9e591608eb54f72e79071dbb61f3707 | [
"RSA-MD"
] | null | null | null | src/pages/publisher/nft-create-rights.js | KrisMit/vine-dev-static | c60d15f9b9e591608eb54f72e79071dbb61f3707 | [
"RSA-MD"
] | null | null | null | src/pages/publisher/nft-create-rights.js | KrisMit/vine-dev-static | c60d15f9b9e591608eb54f72e79071dbb61f3707 | [
"RSA-MD"
] | null | null | null | import React from 'react'
import VineLayout from "../../components/vineLayout"
import Seo from "../../components/seo"
import Box from '@mui/material/Box';
import TableRights from "../../components/tableRights";
import UploadButtons from '../../components/uploadButtons';
import Input from '@mui/material/Input';
import DropDown from "../../components/Level";
import Level from '../../components/Level';
import TableR from '../../components/tableR';
const ariaLabel = { 'aria-label': 'description' };
const NftCreateRightsPage = () => {
return (
<>
<VineLayout>
<Seo title="Vine investments - publisher NFT create Rights" />
<Box sx={{ display: 'flex', flexGrow: 1, height: 100, backgroundColor: "rgb(9,74,120)" , alignItems: "center", justifyContent: "center", marginTop: 0.5 }}>
<h1 style={{ color: 'white' }}>NFT Create - Rights</h1>
</Box>
<div style={{ fontSize: 40, marginTop: '2%', marginLeft: '33%', marginBottom: 10}}>Rights ownership documentation</div><br/>
<Input sx={{ display: 'flex', marginLeft:'40%', marginRight:'40%', flexGrow: 1, alignItems: "center", justifyContent: "center", marginTop: 0.5 }} defaultValue="Name" inputProps={ariaLabel} /> <br/>
<Input sx={{ display: 'flex', marginLeft:'40%', marginRight:'40%', flexGrow: 1, alignItems: "center", justifyContent: "center", marginTop: 0.5 }} defaultValue="Description" inputProps={ariaLabel} /><br/>
<Input sx={{ display: 'flex', marginLeft:'40%', marginRight:'40%', flexGrow: 1, alignItems: "center", justifyContent: "center", marginTop: 0.5 }} defaultValue="Role" inputProps={ariaLabel} /><br/>
<UploadButtons sx={{ display: 'flex', marginLeft:'40%', marginRight:'40%',flexGrow: 1, alignItems: "center", justifyContent: "center",}} /> <br/>
<Level sx={{ display: 'flex', marginLeft:'40%', marginRight:'40%', marginTop: 4, marginBottom: 15, flexGrow: 1, backgroundColor: "rgb(9,74,120)" , alignItems: "center", justifyContent: "center", marginBottom: 25 }} /><br/>
{/* <TableRights /> */}
<TableR />
</VineLayout>
</>
)
}
export default NftCreateRightsPage | 50.44186 | 232 | 0.64592 |
5236fb383323ce4cd061c6749b5659b5a83b6a81 | 79 | sql | SQL | Example/src/main/resources/schema.sql | edtoktay/DynamicCompiler | ce25767fe400be81cc6c38c1a5dd1ee1f3aa7aa2 | [
"MIT"
] | 4 | 2017-11-30T03:32:29.000Z | 2021-11-09T02:45:56.000Z | Example/src/main/resources/schema.sql | fucora/DynamicCompiler | ce25767fe400be81cc6c38c1a5dd1ee1f3aa7aa2 | [
"MIT"
] | null | null | null | Example/src/main/resources/schema.sql | fucora/DynamicCompiler | ce25767fe400be81cc6c38c1a5dd1ee1f3aa7aa2 | [
"MIT"
] | 3 | 2019-04-28T12:40:22.000Z | 2021-11-09T02:45:57.000Z | create table if not exists app_users (
username varchar,
password varchar
);
| 15.8 | 38 | 0.772152 |
e6af9221ffbcf7c585e566360b4e0b31c701ac79 | 95 | sql | SQL | tests/queries/049-unusable-constraint-4.sql | pydemo/spv_14.4 | ad3b62d6bdbbfc29e56391f512ba0ee17dad4eb7 | [
"Apache-2.0"
] | null | null | null | tests/queries/049-unusable-constraint-4.sql | pydemo/spv_14.4 | ad3b62d6bdbbfc29e56391f512ba0ee17dad4eb7 | [
"Apache-2.0"
] | null | null | null | tests/queries/049-unusable-constraint-4.sql | pydemo/spv_14.4 | ad3b62d6bdbbfc29e56391f512ba0ee17dad4eb7 | [
"Apache-2.0"
] | null | null | null | select nn1.int8_1 from no_nulls1 nn1 join no_nulls1 nn2 using (int8_1) where nn1.int8_1 = 0;
0
| 31.666667 | 92 | 0.778947 |
874fc1041e0b6446558f8d9eb26c12111a55d72b | 2,595 | html | HTML | resources/www/templates/header.html | ankurkotwal/metarefcard | 06e8b11640ed00985af7cc136b47bf5c8a46b364 | [
"Apache-2.0"
] | null | null | null | resources/www/templates/header.html | ankurkotwal/metarefcard | 06e8b11640ed00985af7cc136b47bf5c8a46b364 | [
"Apache-2.0"
] | 2 | 2020-11-05T11:25:11.000Z | 2021-10-06T03:57:14.000Z | resources/www/templates/header.html | ankurkotwal/metarefcard | 06e8b11640ed00985af7cc136b47bf5c8a46b364 | [
"Apache-2.0"
] | 1 | 2020-11-04T14:06:27.000Z | 2020-11-04T14:06:27.000Z | <!doctype html>
<html lang="en">
<link rel="stylesheet" href="main.css">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{{ .Title }} ({{ .Version }})</title>
<!-- Bootswatch Cosmo CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.5.2/cosmo/bootstrap.min.css"
integrity="sha384-5QFXyVb+lrCzdN228VS3HmzpiE7ZVwLQtkt+0d9W43LQMzz4HBnnqvVxKg6O+04d" crossorigin="anonymous">
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-162065712-2', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-162065712-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-162065712-2');
</script>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
crossorigin="anonymous"></script>
<script src="script.js"></script>
</head>
<body style="background-color: #e9ecef">
{{template "navbar.html" .}}
<div class="container-fluid tab-content jumbotron">
<blockquote class="blockquote">
<br>
<p class="mb-0">Welcome to MetaRefCard (v{{ .Version }}), a game controller reference card
generator. <br>MetaRefCard is in early access.
If you find any issues, please report them <a
href="https://github.com/ankurkotwal/metarefcard/issues/new?assignees=&labels=&template=bug_report.md&title=">here</a>.
</p>
</blockquote> | 43.983051 | 129 | 0.684393 |
86cc28299c0636c1de7a6abecc5166df288954ca | 29,059 | rs | Rust | src/mcan0/mcan_ir.rs | ju6ge/atsame70q21 | 328e7a7aa4b69f164acb1ebb7f4a0bea300e6723 | [
"MIT"
] | 1 | 2020-04-07T19:47:23.000Z | 2020-04-07T19:47:23.000Z | src/mcan0/mcan_ir.rs | ju6ge/atsame70q21 | 328e7a7aa4b69f164acb1ebb7f4a0bea300e6723 | [
"MIT"
] | null | null | null | src/mcan0/mcan_ir.rs | ju6ge/atsame70q21 | 328e7a7aa4b69f164acb1ebb7f4a0bea300e6723 | [
"MIT"
] | null | null | null | #[doc = "Reader of register MCAN_IR"]
pub type R = crate::R<u32, super::MCAN_IR>;
#[doc = "Writer for register MCAN_IR"]
pub type W = crate::W<u32, super::MCAN_IR>;
#[doc = "Register MCAN_IR `reset()`'s with value 0"]
impl crate::ResetValue for super::MCAN_IR {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `RF0N`"]
pub type RF0N_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF0N`"]
pub struct RF0N_W<'a> {
w: &'a mut W,
}
impl<'a> RF0N_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
self.w
}
}
#[doc = "Reader of field `RF0W`"]
pub type RF0W_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF0W`"]
pub struct RF0W_W<'a> {
w: &'a mut W,
}
impl<'a> RF0W_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "Reader of field `RF0F`"]
pub type RF0F_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF0F`"]
pub struct RF0F_W<'a> {
w: &'a mut W,
}
impl<'a> RF0F_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
self.w
}
}
#[doc = "Reader of field `RF0L`"]
pub type RF0L_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF0L`"]
pub struct RF0L_W<'a> {
w: &'a mut W,
}
impl<'a> RF0L_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
self.w
}
}
#[doc = "Reader of field `RF1N`"]
pub type RF1N_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF1N`"]
pub struct RF1N_W<'a> {
w: &'a mut W,
}
impl<'a> RF1N_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
self.w
}
}
#[doc = "Reader of field `RF1W`"]
pub type RF1W_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF1W`"]
pub struct RF1W_W<'a> {
w: &'a mut W,
}
impl<'a> RF1W_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
self.w
}
}
#[doc = "Reader of field `RF1F`"]
pub type RF1F_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF1F`"]
pub struct RF1F_W<'a> {
w: &'a mut W,
}
impl<'a> RF1F_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
self.w
}
}
#[doc = "Reader of field `RF1L`"]
pub type RF1L_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RF1L`"]
pub struct RF1L_W<'a> {
w: &'a mut W,
}
impl<'a> RF1L_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
self.w
}
}
#[doc = "Reader of field `HPM`"]
pub type HPM_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `HPM`"]
pub struct HPM_W<'a> {
w: &'a mut W,
}
impl<'a> HPM_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
self.w
}
}
#[doc = "Reader of field `TC`"]
pub type TC_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TC`"]
pub struct TC_W<'a> {
w: &'a mut W,
}
impl<'a> TC_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
self.w
}
}
#[doc = "Reader of field `TCF`"]
pub type TCF_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TCF`"]
pub struct TCF_W<'a> {
w: &'a mut W,
}
impl<'a> TCF_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
self.w
}
}
#[doc = "Reader of field `TFE`"]
pub type TFE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TFE`"]
pub struct TFE_W<'a> {
w: &'a mut W,
}
impl<'a> TFE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
self.w
}
}
#[doc = "Reader of field `TEFN`"]
pub type TEFN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TEFN`"]
pub struct TEFN_W<'a> {
w: &'a mut W,
}
impl<'a> TEFN_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
self.w
}
}
#[doc = "Reader of field `TEFW`"]
pub type TEFW_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TEFW`"]
pub struct TEFW_W<'a> {
w: &'a mut W,
}
impl<'a> TEFW_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
self.w
}
}
#[doc = "Reader of field `TEFF`"]
pub type TEFF_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TEFF`"]
pub struct TEFF_W<'a> {
w: &'a mut W,
}
impl<'a> TEFF_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
self.w
}
}
#[doc = "Reader of field `TEFL`"]
pub type TEFL_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TEFL`"]
pub struct TEFL_W<'a> {
w: &'a mut W,
}
impl<'a> TEFL_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
self.w
}
}
#[doc = "Reader of field `TSW`"]
pub type TSW_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TSW`"]
pub struct TSW_W<'a> {
w: &'a mut W,
}
impl<'a> TSW_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
self.w
}
}
#[doc = "Reader of field `MRAF`"]
pub type MRAF_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `MRAF`"]
pub struct MRAF_W<'a> {
w: &'a mut W,
}
impl<'a> MRAF_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
self.w
}
}
#[doc = "Reader of field `TOO`"]
pub type TOO_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TOO`"]
pub struct TOO_W<'a> {
w: &'a mut W,
}
impl<'a> TOO_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
self.w
}
}
#[doc = "Reader of field `DRX`"]
pub type DRX_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `DRX`"]
pub struct DRX_W<'a> {
w: &'a mut W,
}
impl<'a> DRX_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19);
self.w
}
}
#[doc = "Reader of field `ELO`"]
pub type ELO_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ELO`"]
pub struct ELO_W<'a> {
w: &'a mut W,
}
impl<'a> ELO_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
self.w
}
}
#[doc = "Reader of field `EP`"]
pub type EP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `EP`"]
pub struct EP_W<'a> {
w: &'a mut W,
}
impl<'a> EP_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23);
self.w
}
}
#[doc = "Reader of field `EW`"]
pub type EW_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `EW`"]
pub struct EW_W<'a> {
w: &'a mut W,
}
impl<'a> EW_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
self.w
}
}
#[doc = "Reader of field `BO`"]
pub type BO_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `BO`"]
pub struct BO_W<'a> {
w: &'a mut W,
}
impl<'a> BO_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25);
self.w
}
}
#[doc = "Reader of field `WDI`"]
pub type WDI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDI`"]
pub struct WDI_W<'a> {
w: &'a mut W,
}
impl<'a> WDI_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26);
self.w
}
}
#[doc = "Reader of field `CRCE`"]
pub type CRCE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CRCE`"]
pub struct CRCE_W<'a> {
w: &'a mut W,
}
impl<'a> CRCE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27);
self.w
}
}
#[doc = "Reader of field `BE`"]
pub type BE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `BE`"]
pub struct BE_W<'a> {
w: &'a mut W,
}
impl<'a> BE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
self.w
}
}
#[doc = "Reader of field `ACKE`"]
pub type ACKE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ACKE`"]
pub struct ACKE_W<'a> {
w: &'a mut W,
}
impl<'a> ACKE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29);
self.w
}
}
#[doc = "Reader of field `FOE`"]
pub type FOE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FOE`"]
pub struct FOE_W<'a> {
w: &'a mut W,
}
impl<'a> FOE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30);
self.w
}
}
#[doc = "Reader of field `STE`"]
pub type STE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `STE`"]
pub struct STE_W<'a> {
w: &'a mut W,
}
impl<'a> STE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
self.w
}
}
impl R {
#[doc = "Bit 0 - Receive FIFO 0 New Message"]
#[inline(always)]
pub fn rf0n(&self) -> RF0N_R {
RF0N_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Receive FIFO 0 Watermark Reached"]
#[inline(always)]
pub fn rf0w(&self) -> RF0W_R {
RF0W_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Receive FIFO 0 Full"]
#[inline(always)]
pub fn rf0f(&self) -> RF0F_R {
RF0F_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Receive FIFO 0 Message Lost"]
#[inline(always)]
pub fn rf0l(&self) -> RF0L_R {
RF0L_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4 - Receive FIFO 1 New Message"]
#[inline(always)]
pub fn rf1n(&self) -> RF1N_R {
RF1N_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5 - Receive FIFO 1 Watermark Reached"]
#[inline(always)]
pub fn rf1w(&self) -> RF1W_R {
RF1W_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 6 - Receive FIFO 1 Full"]
#[inline(always)]
pub fn rf1f(&self) -> RF1F_R {
RF1F_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Receive FIFO 1 Message Lost"]
#[inline(always)]
pub fn rf1l(&self) -> RF1L_R {
RF1L_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 8 - High Priority Message"]
#[inline(always)]
pub fn hpm(&self) -> HPM_R {
HPM_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 9 - Transmission Completed"]
#[inline(always)]
pub fn tc(&self) -> TC_R {
TC_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 10 - Transmission Cancellation Finished"]
#[inline(always)]
pub fn tcf(&self) -> TCF_R {
TCF_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 11 - Tx FIFO Empty"]
#[inline(always)]
pub fn tfe(&self) -> TFE_R {
TFE_R::new(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 12 - Tx Event FIFO New Entry"]
#[inline(always)]
pub fn tefn(&self) -> TEFN_R {
TEFN_R::new(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 13 - Tx Event FIFO Watermark Reached"]
#[inline(always)]
pub fn tefw(&self) -> TEFW_R {
TEFW_R::new(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 14 - Tx Event FIFO Full"]
#[inline(always)]
pub fn teff(&self) -> TEFF_R {
TEFF_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 15 - Tx Event FIFO Element Lost"]
#[inline(always)]
pub fn tefl(&self) -> TEFL_R {
TEFL_R::new(((self.bits >> 15) & 0x01) != 0)
}
#[doc = "Bit 16 - Timestamp Wraparound"]
#[inline(always)]
pub fn tsw(&self) -> TSW_R {
TSW_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 17 - Message RAM Access Failure"]
#[inline(always)]
pub fn mraf(&self) -> MRAF_R {
MRAF_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 18 - Timeout Occurred"]
#[inline(always)]
pub fn too(&self) -> TOO_R {
TOO_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 19 - Message stored to Dedicated Receive Buffer"]
#[inline(always)]
pub fn drx(&self) -> DRX_R {
DRX_R::new(((self.bits >> 19) & 0x01) != 0)
}
#[doc = "Bit 22 - Error Logging Overflow"]
#[inline(always)]
pub fn elo(&self) -> ELO_R {
ELO_R::new(((self.bits >> 22) & 0x01) != 0)
}
#[doc = "Bit 23 - Error Passive"]
#[inline(always)]
pub fn ep(&self) -> EP_R {
EP_R::new(((self.bits >> 23) & 0x01) != 0)
}
#[doc = "Bit 24 - Warning Status"]
#[inline(always)]
pub fn ew(&self) -> EW_R {
EW_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bit 25 - Bus_Off Status"]
#[inline(always)]
pub fn bo(&self) -> BO_R {
BO_R::new(((self.bits >> 25) & 0x01) != 0)
}
#[doc = "Bit 26 - Watchdog Interrupt"]
#[inline(always)]
pub fn wdi(&self) -> WDI_R {
WDI_R::new(((self.bits >> 26) & 0x01) != 0)
}
#[doc = "Bit 27 - CRC Error"]
#[inline(always)]
pub fn crce(&self) -> CRCE_R {
CRCE_R::new(((self.bits >> 27) & 0x01) != 0)
}
#[doc = "Bit 28 - Bit Error"]
#[inline(always)]
pub fn be(&self) -> BE_R {
BE_R::new(((self.bits >> 28) & 0x01) != 0)
}
#[doc = "Bit 29 - Acknowledge Error"]
#[inline(always)]
pub fn acke(&self) -> ACKE_R {
ACKE_R::new(((self.bits >> 29) & 0x01) != 0)
}
#[doc = "Bit 30 - Format Error"]
#[inline(always)]
pub fn foe(&self) -> FOE_R {
FOE_R::new(((self.bits >> 30) & 0x01) != 0)
}
#[doc = "Bit 31 - Stuff Error"]
#[inline(always)]
pub fn ste(&self) -> STE_R {
STE_R::new(((self.bits >> 31) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Receive FIFO 0 New Message"]
#[inline(always)]
pub fn rf0n(&mut self) -> RF0N_W {
RF0N_W { w: self }
}
#[doc = "Bit 1 - Receive FIFO 0 Watermark Reached"]
#[inline(always)]
pub fn rf0w(&mut self) -> RF0W_W {
RF0W_W { w: self }
}
#[doc = "Bit 2 - Receive FIFO 0 Full"]
#[inline(always)]
pub fn rf0f(&mut self) -> RF0F_W {
RF0F_W { w: self }
}
#[doc = "Bit 3 - Receive FIFO 0 Message Lost"]
#[inline(always)]
pub fn rf0l(&mut self) -> RF0L_W {
RF0L_W { w: self }
}
#[doc = "Bit 4 - Receive FIFO 1 New Message"]
#[inline(always)]
pub fn rf1n(&mut self) -> RF1N_W {
RF1N_W { w: self }
}
#[doc = "Bit 5 - Receive FIFO 1 Watermark Reached"]
#[inline(always)]
pub fn rf1w(&mut self) -> RF1W_W {
RF1W_W { w: self }
}
#[doc = "Bit 6 - Receive FIFO 1 Full"]
#[inline(always)]
pub fn rf1f(&mut self) -> RF1F_W {
RF1F_W { w: self }
}
#[doc = "Bit 7 - Receive FIFO 1 Message Lost"]
#[inline(always)]
pub fn rf1l(&mut self) -> RF1L_W {
RF1L_W { w: self }
}
#[doc = "Bit 8 - High Priority Message"]
#[inline(always)]
pub fn hpm(&mut self) -> HPM_W {
HPM_W { w: self }
}
#[doc = "Bit 9 - Transmission Completed"]
#[inline(always)]
pub fn tc(&mut self) -> TC_W {
TC_W { w: self }
}
#[doc = "Bit 10 - Transmission Cancellation Finished"]
#[inline(always)]
pub fn tcf(&mut self) -> TCF_W {
TCF_W { w: self }
}
#[doc = "Bit 11 - Tx FIFO Empty"]
#[inline(always)]
pub fn tfe(&mut self) -> TFE_W {
TFE_W { w: self }
}
#[doc = "Bit 12 - Tx Event FIFO New Entry"]
#[inline(always)]
pub fn tefn(&mut self) -> TEFN_W {
TEFN_W { w: self }
}
#[doc = "Bit 13 - Tx Event FIFO Watermark Reached"]
#[inline(always)]
pub fn tefw(&mut self) -> TEFW_W {
TEFW_W { w: self }
}
#[doc = "Bit 14 - Tx Event FIFO Full"]
#[inline(always)]
pub fn teff(&mut self) -> TEFF_W {
TEFF_W { w: self }
}
#[doc = "Bit 15 - Tx Event FIFO Element Lost"]
#[inline(always)]
pub fn tefl(&mut self) -> TEFL_W {
TEFL_W { w: self }
}
#[doc = "Bit 16 - Timestamp Wraparound"]
#[inline(always)]
pub fn tsw(&mut self) -> TSW_W {
TSW_W { w: self }
}
#[doc = "Bit 17 - Message RAM Access Failure"]
#[inline(always)]
pub fn mraf(&mut self) -> MRAF_W {
MRAF_W { w: self }
}
#[doc = "Bit 18 - Timeout Occurred"]
#[inline(always)]
pub fn too(&mut self) -> TOO_W {
TOO_W { w: self }
}
#[doc = "Bit 19 - Message stored to Dedicated Receive Buffer"]
#[inline(always)]
pub fn drx(&mut self) -> DRX_W {
DRX_W { w: self }
}
#[doc = "Bit 22 - Error Logging Overflow"]
#[inline(always)]
pub fn elo(&mut self) -> ELO_W {
ELO_W { w: self }
}
#[doc = "Bit 23 - Error Passive"]
#[inline(always)]
pub fn ep(&mut self) -> EP_W {
EP_W { w: self }
}
#[doc = "Bit 24 - Warning Status"]
#[inline(always)]
pub fn ew(&mut self) -> EW_W {
EW_W { w: self }
}
#[doc = "Bit 25 - Bus_Off Status"]
#[inline(always)]
pub fn bo(&mut self) -> BO_W {
BO_W { w: self }
}
#[doc = "Bit 26 - Watchdog Interrupt"]
#[inline(always)]
pub fn wdi(&mut self) -> WDI_W {
WDI_W { w: self }
}
#[doc = "Bit 27 - CRC Error"]
#[inline(always)]
pub fn crce(&mut self) -> CRCE_W {
CRCE_W { w: self }
}
#[doc = "Bit 28 - Bit Error"]
#[inline(always)]
pub fn be(&mut self) -> BE_W {
BE_W { w: self }
}
#[doc = "Bit 29 - Acknowledge Error"]
#[inline(always)]
pub fn acke(&mut self) -> ACKE_W {
ACKE_W { w: self }
}
#[doc = "Bit 30 - Format Error"]
#[inline(always)]
pub fn foe(&mut self) -> FOE_W {
FOE_W { w: self }
}
#[doc = "Bit 31 - Stuff Error"]
#[inline(always)]
pub fn ste(&mut self) -> STE_W {
STE_W { w: self }
}
}
| 28.022179 | 86 | 0.515606 |
27027a4ece7701ae3a5a0c0acbea3e6542bd9c2d | 957 | h | C | 6_obj_viewer/Engine/render/World.h | hyunjun529/WIN_VS_GL_Setups | 8f49c7889a102f9b48dffd6caf189932032a2bd7 | [
"MIT"
] | 2 | 2019-02-07T06:50:43.000Z | 2020-07-07T01:00:21.000Z | 6_obj_viewer/Engine/render/World.h | hyunjun529/WIN_VS_GL_Setups | 8f49c7889a102f9b48dffd6caf189932032a2bd7 | [
"MIT"
] | null | null | null | 6_obj_viewer/Engine/render/World.h | hyunjun529/WIN_VS_GL_Setups | 8f49c7889a102f9b48dffd6caf189932032a2bd7 | [
"MIT"
] | 5 | 2018-08-28T03:11:04.000Z | 2020-06-09T07:01:12.000Z | #ifndef KATA_RENDER_WINDOW_H_
#define KATA_RENDER_WINDOW_H_
#include <GL/gl3w.h>
#include <GLFW/glfw3.h>
#include "ShaderUtil.h"
namespace kata
{
namespace render
{
class World
{
private:
ShaderUtil shaderUtil;
int m_windowWidth = 400;
int m_windowHeight = 400;
char windowTitle[64] = "??";
public:
GLFWwindow * m_window;
World(int _w = 400, int _h = 400)
: m_windowWidth(_w), m_windowHeight(_h)
{
m_window = glfwCreateWindow(m_windowWidth, m_windowHeight, windowTitle, NULL, NULL);
}
void updateWindowTitle(const char *_title)
{
strncpy_s(windowTitle, _title, sizeof(windowTitle));
glfwSetWindowTitle(m_window, windowTitle);
}
const GLchar *loadShader(const char *_path)
{
if (strcmp(_path, "UVonly.vert") >= 0) return shaderUtil.vertUVonly;
if (strcmp(_path, "UVonly.frag") >= 0) return shaderUtil.fragUVonly;
return "";
}
};
}
}
#endif // KATA_RENDER_WINDOW_H_ | 19.530612 | 88 | 0.682341 |
d2d9095681d6944ada8285efcbeed30f95dd2824 | 9,580 | php | PHP | resources/views/frontend/manages/news.blade.php | AliHossainRingku/hospital_cox | 98bace96a7f70cb261cf4b5d20ebffc64631b49f | [
"MIT"
] | null | null | null | resources/views/frontend/manages/news.blade.php | AliHossainRingku/hospital_cox | 98bace96a7f70cb261cf4b5d20ebffc64631b49f | [
"MIT"
] | null | null | null | resources/views/frontend/manages/news.blade.php | AliHossainRingku/hospital_cox | 98bace96a7f70cb261cf4b5d20ebffc64631b49f | [
"MIT"
] | null | null | null | @extends('frontend.home_layout')
@section('content')
<!-- Inne Page Banner Area Start Here -->
<section class="inner-page-banner bg-common inner-page-top-margin" data-bg-image="frontend/img/figure/figure2.jpg">
<div class="container">
<div class="row">
<div class="col-12">
<div class="breadcrumbs-area">
<h1>Standard Grid News</h1>
<ul>
<li>
<a href="#">Home</a>
</li>
<li>News</li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!-- Inne Page Banner Area End Here -->
<!-- Blog Grid Area Start Here -->
<section class="blog-wrap-layout2 bg-light-primary100">
<div class="container">
<div class="row">
<div class="col-xl-9 col-lg-8 col-12">
<div class="row">
@foreach($news as $data)
<div class="single-item col-md-6 col-sm-12 col-12">
<div class="blog-box-layout4">
<div class="item-img">
<a href="single-news.html">
<img src="{{$data->news_image}}" class="img-fluid" alt="blog">
</a>
<div class="post-date">22
<span>June</span>
</div>
</div>
<div class="item-content">
<h3 class="item-title">
<a href="{{url('/news/'.$data->id)}}">{{$data->news_title}}</a>
</h3>
<p class="line-of-3-texts">{{$data->news_description}}.
</p>
<div class="post-actions-wrapper">
<ul>
<li>
<a href="#">
<i class="flaticon-people"></i>by
<span>admin</span>
</a>
</li>
<li>
<a href="#">
<i class="flaticon-interface"></i>15</a>
</li>
</ul>
</div>
</div>
</div>
</div>
@endforeach
</div>
<ul class="pagination-layout1 margin-t-20">
<li>
<a href="#">Previous</a>
</li>
<li class="active">
<a href="#">1</a>
</li>
<li>
<a href="#">2</a>
</li>
<li>
<a href="#">3</a>
</li>
<li>
<a href="#">Next</a>
</li>
</ul>
</div>
<div class="sidebar-widget-area sidebar-break-md col-xl-3 col-lg-4 col-12">
<div class="widget widget-search">
<h3 class="section-title title-bar-primary">Search Keywords</h3>
<div class="input-group stylish-input-group">
<input type="text" class="form-control" placeholder="Search Here . . .">
<span class="input-group-addon">
<button type="submit">
<span class="flaticon-search" aria-hidden="true"></span>
</button>
</span>
</div>
</div>
<div class="widget widget-categories">
<h3 class="section-title title-bar-primary">Categories</h3>
<ul>
<?php $departments = DB::table('departments')
->where('publication_status',1)
->get();
?>
@foreach($departments as $data)
<li>
<a href="#">{{$data->department_name}}
<span>15</span>
</a>
</li>
@endforeach
</ul>
</div>
<div class="widget widget-recent">
<h3 class="section-title title-bar-primary">Related Posts</h3>
<div class="media">
<a href="#">
<img src="img/blog/blog6.jpg" alt="news" class="img-fluid">
</a>
<div class="media-body space-sm">
<div class="post-date">June 27, 2018</div>
<h4 class="post-title">
<a href="#">Achieving Better Health Cancer treatment for.</a>
</h4>
</div>
</div>
<div class="media">
<a href="#">
<img src="img/blog/blog7.jpg" alt="news" class="img-fluid">
</a>
<div class="media-body space-sm">
<div class="post-date">June 27, 2018</div>
<h4 class="post-title">
<a href="#">Achieving Better Health Cancer treatment for.</a>
</h4>
</div>
</div>
<div class="media">
<a href="#">
<img src="img/blog/blog8.jpg" alt="news" class="img-fluid">
</a>
<div class="media-body space-sm">
<div class="post-date">June 27, 2018</div>
<h4 class="post-title">
<a href="#">Achieving Better Health Cancer treatment for.</a>
</h4>
</div>
</div>
<div class="media">
<a href="#">
<img src="img/blog/blog9.jpg" alt="news" class="img-fluid">
</a>
<div class="media-body space-sm">
<div class="post-date">June 27, 2018</div>
<h4 class="post-title">
<a href="#">Achieving Better Health Cancer treatment for.</a>
</h4>
</div>
</div>
</div>
<div class="widget widget-tag">
<h3 class="section-title title-bar-primary">Tags</h3>
<ul>
<?php $departments = DB::table('departments')
->where('publication_status',1)
->get();
?>
@foreach($departments as $data)
<li>
<a href="#">{{$data->department_name}}</a>
</li>
@endforeach
</ul>
</div>
</div>
</div>
</div>
</section>
<!-- Blog Grid Area End Here -->
@endsection
<style type="text/css">
.line-of-3-texts {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4; /* number of lines to show */
-webkit-box-orient: vertical;
}
</style> | 49.128205 | 123 | 0.281733 |
90e5a3c2f658934cbf13a8422e77a8a7a8150e59 | 1,955 | py | Python | confusionMatrix.py | anirbanghoshsbi/pandas-technical-indicators | 8e342117866dec85e1b47d263225ef12812e7df7 | [
"MIT"
] | null | null | null | confusionMatrix.py | anirbanghoshsbi/pandas-technical-indicators | 8e342117866dec85e1b47d263225ef12812e7df7 | [
"MIT"
] | null | null | null | confusionMatrix.py | anirbanghoshsbi/pandas-technical-indicators | 8e342117866dec85e1b47d263225ef12812e7df7 | [
"MIT"
] | null | null | null |
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix, plot_confusion_matrix
import numpy as np
def confus_matrix(signalflag , prediction , model=False ,X_test=False,y_test=False ,plot=False , test=True):
''' #cm.confus_matrix(actual_results,predictions,model,<test data(or new_data for prediction except target VAR)>,<actaul Target VAR> ,<plot=True>)
Signal_Flag : Pandas Series of Actual Data Points
predictions : Pandas Series of Predicted Data points
model : trained model
returns : the confusion matrix and accuracy , precision , recall
and specificity.
'''
rf_matrix = confusion_matrix(signalflag,prediction)
true_negatives = rf_matrix[0][0]
false_negatives = rf_matrix[1][0]
true_positives = rf_matrix[1][1]
false_positives = rf_matrix[0][1]
accuracy = (true_negatives + true_positives) / (true_negatives + true_positives + false_negatives + false_positives)
percision = true_positives / (true_positives + false_positives)
recall = true_positives / (true_positives + false_negatives)
specificity = true_negatives / (true_negatives + false_positives)
print('Accuracy: {}'.format(float(accuracy)*100))
print('Percision: {}'.format(float(percision)*100))
print('Recall: {}'.format(float(recall)*100))
print('Specificity: {}'.format(float(specificity)*100))
if plot==True and test==True:
disp = plot_confusion_matrix(model, X_test, y_test, display_labels = ['Down Day', 'Up Day'], normalize = 'true', cmap=plt.cm.Blues)
disp.ax_.set_title('Confusion Matrix - Normalized for the Testing Dataset')
plt.show()
elif plot==True and test==False:
disp = plot_confusion_matrix(model, X_test, y_test, display_labels = ['Down Day', 'Up Day'], normalize = 'true', cmap=plt.cm.Blues)
disp.ax_.set_title('Confusion Matrix - Normalized for the Actual Trading Data')
plt.show()
| 51.447368 | 150 | 0.707417 |
26427e941ca958b404608a5d17094b7e03cf3af7 | 342,181 | java | Java | y/src/Y.java | ywanes/utility_y | e62671086cf90a03ea2f39883d13d3902152768d | [
"MIT"
] | null | null | null | y/src/Y.java | ywanes/utility_y | e62671086cf90a03ea2f39883d13d3902152768d | [
"MIT"
] | null | null | null | y/src/Y.java | ywanes/utility_y | e62671086cf90a03ea2f39883d13d3902152768d | [
"MIT"
] | null | null | null | //
// curl https://www.datanucleus.org/downloads/maven2/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar > ojdbc6.jar
// curl https://repo.clojars.org/com/microsoft/sqljdbc4/3.0/sqljdbc4-3.0.jar > sqljdbc4-3.0.jar
// curl http://121.42.227.72:8081/nexus/content/groups/public/mysql/mysql-connector-java/8.0.26/mysql-connector-java-8.0.26.jar > mysql-connector-java-8.0.26.jar
// curl https://ufpr.dl.sourceforge.net/project/jsch/jsch.jar/0.1.55/jsch-0.1.55.jar > jsch-0.1.55.jar
// curl https://raw.githubusercontent.com/ywanes/utility_y/master/y/src/Y.java > Y.java
// javac -encoding UTF-8 -cp .:ojdbc6.jar:sqljdbc4-3.0.jar:mysql-connector-java-8.0.26.jar:jsch-0.1.55.jar Y.java
// javac -encoding ISO-8859-1 -cp .;ojdbc6.jar;sqljdbc4-3.0.jar;mysql-connector-java-8.0.26.jar;jsch-0.1.55.jar Y.java
// alias y='java -cp /y:/y/ojdbc6.jar:/y/sqljdbc4-3.0.jar:/y/mysql-connector-java-8.0.26.jar:/y/jsch-0.1.55.jar Y'
// crétidos "ssh/scp/sftp/sshExec" https://ufpr.dl.sourceforge.net/project/jsch/jsch.jar/0.1.55/jsch-0.1.55.jar
// crétidos https://github.com/is/jsch/tree/master/examples
//
import com.jcraft.jsch.*;
import java.awt.*;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.io.*;
import java.net.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.ProgressMonitor;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JOptionPane;
public class Y {
//public static String local_env=null;
public static String local_env="c:\\tmp";
public static int BUFFER_SIZE=1024;
public static String linhaCSV=null;
public static int ponteiroLinhaCSV=0;
public static String sepCSV=getSeparadorCSV(); // ";";
public static int n_lines_buffer_DEFAULT=500;
public String [] ORAs=new String[]{};
public String [] suportIconv=new String[]{"ISO-8859-1","UTF-8","UTF-8BOM","UCS-2LE","UCS-2LEBOM"};
public int [] BOM_UTF_8=new int[]{239,187,191};
public int [] BOM_UCS_2LE=new int[]{255,254};
public String erroSequenciaIlegal="Erro, sequencia ilegal!";
// octal bytes
public static String [] OD_BC_B=new String[]{" 000"," 001"," 002"," 003"," 004"," 005"," 006"," 007"," 010"," 011"," 012"," 013"," 014"," 015"," 016"," 017"," 020"," 021"," 022"," 023"," 024"," 025"," 026"," 027"," 030"," 031"," 032"," 033"," 034"," 035"," 036"," 037"," 040"," 041"," 042"," 043"," 044"," 045"," 046"," 047"," 050"," 051"," 052"," 053"," 054"," 055"," 056"," 057"," 060"," 061"," 062"," 063"," 064"," 065"," 066"," 067"," 070"," 071"," 072"," 073"," 074"," 075"," 076"," 077"," 100"," 101"," 102"," 103"," 104"," 105"," 106"," 107"," 110"," 111"," 112"," 113"," 114"," 115"," 116"," 117"," 120"," 121"," 122"," 123"," 124"," 125"," 126"," 127"," 130"," 131"," 132"," 133"," 134"," 135"," 136"," 137"," 140"," 141"," 142"," 143"," 144"," 145"," 146"," 147"," 150"," 151"," 152"," 153"," 154"," 155"," 156"," 157"," 160"," 161"," 162"," 163"," 164"," 165"," 166"," 167"," 170"," 171"," 172"," 173"," 174"," 175"," 176"," 177"," 200"," 201"," 202"," 203"," 204"," 205"," 206"," 207"," 210"," 211"," 212"," 213"," 214"," 215"," 216"," 217"," 220"," 221"," 222"," 223"," 224"," 225"," 226"," 227"," 230"," 231"," 232"," 233"," 234"," 235"," 236"," 237"," 240"," 241"," 242"," 243"," 244"," 245"," 246"," 247"," 250"," 251"," 252"," 253"," 254"," 255"," 256"," 257"," 260"," 261"," 262"," 263"," 264"," 265"," 266"," 267"," 270"," 271"," 272"," 273"," 274"," 275"," 276"," 277"," 300"," 301"," 302"," 303"," 304"," 305"," 306"," 307"," 310"," 311"," 312"," 313"," 314"," 315"," 316"," 317"," 320"," 321"," 322"," 323"," 324"," 325"," 326"," 327"," 330"," 331"," 332"," 333"," 334"," 335"," 336"," 337"," 340"," 341"," 342"," 343"," 344"," 345"," 346"," 347"," 350"," 351"," 352"," 353"," 354"," 355"," 356"," 357"," 360"," 361"," 362"," 363"," 364"," 365"," 366"," 367"," 370"," 371"," 372"," 373"," 374"," 375"," 376"," 377"};
// caracteres
public static String [] OD_BC_C=new String[]{" \\0"," 001"," 002"," 003"," 004"," 005"," 006"," \\a"," \\b"," \\t"," \\n"," \\v"," \\f"," \\r"," 016"," 017"," 020"," 021"," 022"," 023"," 024"," 025"," 026"," 027"," 030"," 031"," 032"," 033"," 034"," 035"," 036"," 037"," "," !"," \""," #"," $"," %"," &"," '"," ("," )"," *"," +"," ,"," -"," ."," /"," 0"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9"," :"," ;"," <"," ="," >"," ?"," @"," A"," B"," C"," D"," E"," F"," G"," H"," I"," J"," K"," L"," M"," N"," O"," P"," Q"," R"," S"," T"," U"," V"," W"," X"," Y"," Z"," ["," \\"," ]"," ^"," _"," `"," a"," b"," c"," d"," e"," f"," g"," h"," i"," j"," k"," l"," m"," n"," o"," p"," q"," r"," s"," t"," u"," v"," w"," x"," y"," z"," {"," |"," }"," ~"," 177"," 200"," 201"," 202"," 203"," 204"," 205"," 206"," 207"," 210"," 211"," 212"," 213"," 214"," 215"," 216"," 217"," 220"," 221"," 222"," 223"," 224"," 225"," 226"," 227"," 230"," 231"," 232"," 233"," 234"," 235"," 236"," 237"," 240"," 241"," 242"," 243"," 244"," 245"," 246"," 247"," 250"," 251"," 252"," 253"," 254"," 255"," 256"," 257"," 260"," 261"," 262"," 263"," 264"," 265"," 266"," 267"," 270"," 271"," 272"," 273"," 274"," 275"," 276"," 277"," 300"," 301"," 302"," 303"," 304"," 305"," 306"," 307"," 310"," 311"," 312"," 313"," 314"," 315"," 316"," 317"," 320"," 321"," 322"," 323"," 324"," 325"," 326"," 327"," 330"," 331"," 332"," 333"," 334"," 335"," 336"," 337"," 340"," 341"," 342"," 343"," 344"," 345"," 346"," 347"," 350"," 351"," 352"," 353"," 354"," 355"," 356"," 357"," 360"," 361"," 362"," 363"," 364"," 365"," 366"," 367"," 370"," 371"," 372"," 373"," 374"," 375"," 376"," 377"};
// 0...256
public static String [] OD_BC_R=new String[]{" 0"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9"," 10"," 11"," 12"," 13"," 14"," 15"," 16"," 17"," 18"," 19"," 20"," 21"," 22"," 23"," 24"," 25"," 26"," 27"," 28"," 29"," 30"," 31"," 32"," 33"," 34"," 35"," 36"," 37"," 38"," 39"," 40"," 41"," 42"," 43"," 44"," 45"," 46"," 47"," 48"," 49"," 50"," 51"," 52"," 53"," 54"," 55"," 56"," 57"," 58"," 59"," 60"," 61"," 62"," 63"," 64"," 65"," 66"," 67"," 68"," 69"," 70"," 71"," 72"," 73"," 74"," 75"," 76"," 77"," 78"," 79"," 80"," 81"," 82"," 83"," 84"," 85"," 86"," 87"," 88"," 89"," 90"," 91"," 92"," 93"," 94"," 95"," 96"," 97"," 98"," 99"," 100"," 101"," 102"," 103"," 104"," 105"," 106"," 107"," 108"," 109"," 110"," 111"," 112"," 113"," 114"," 115"," 116"," 117"," 118"," 119"," 120"," 121"," 122"," 123"," 124"," 125"," 126"," 127"," 128"," 129"," 130"," 131"," 132"," 133"," 134"," 135"," 136"," 137"," 138"," 139"," 140"," 141"," 142"," 143"," 144"," 145"," 146"," 147"," 148"," 149"," 150"," 151"," 152"," 153"," 154"," 155"," 156"," 157"," 158"," 159"," 160"," 161"," 162"," 163"," 164"," 165"," 166"," 167"," 168"," 169"," 170"," 171"," 172"," 173"," 174"," 175"," 176"," 177"," 178"," 179"," 180"," 181"," 182"," 183"," 184"," 185"," 186"," 187"," 188"," 189"," 190"," 191"," 192"," 193"," 194"," 195"," 196"," 197"," 198"," 199"," 200"," 201"," 202"," 203"," 204"," 205"," 206"," 207"," 208"," 209"," 210"," 211"," 212"," 213"," 214"," 215"," 216"," 217"," 218"," 219"," 220"," 221"," 222"," 223"," 224"," 225"," 226"," 227"," 228"," 229"," 230"," 231"," 232"," 233"," 234"," 235"," 236"," 237"," 238"," 239"," 240"," 241"," 242"," 243"," 244"," 245"," 246"," 247"," 248"," 249"," 250"," 251"," 252"," 253"," 254"," 255"};
// ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
public static int [] indexBase64 = new int []{65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47};
// ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
public static String txtBase64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
int BARRA_R=13; // \r
int CHAR_R=114; // r
int BARRA_N=10; // \n
int CHAR_N=110; // n
int BARRA_0=0; // \0
int CHAR_0=48; // 0
int BARRA_A=7; // \a
int CHAR_A=97; // a
int BARRA_B=8; // \b
int CHAR_B=98; // b
int BARRA_T=9; // \t
int CHAR_T=116; // t
int BARRA_V=11; // \v
int CHAR_V=118; // v
int BARRA_F=12; // \f
int CHAR_F=102; // f
int CHAR_BARRA=92; // \\ => \
int V_0b00000011=3; // 0b00000011 (3)
int V_0b0000000011=3; // 0b0000000011 (3)
int V_0b0000001111=15; // 0b0000001111 (15)
int V_0b000000001111=15; // 0b000000001111 (15)
int V_0b000000111111=63; // 0b000000111111 (63)
int V_0b11111100=252; // 0b11111100 (252)
int V_0b1111110000=1008; // 0b1111110000 (1008)
int V_0b1111111100=1020; // 0b1111111100 (1020)
int V_0b111111000000=4032; // 0b111111000000 (4032)
int V_0b111111110000=4080; // 0b111111110000 (4080)
public static void main(String[] args) {
/*
# criando tabela a com 400k registros
y banco conn,hash execute "drop table a"
y banco conn,hash execute "create table a ( C1 varchar2(3000), C2 varchar2(3000), C3 varchar2(3000) )"
y banco conn,hash execute "insert into a values('123456789','123456789','123456789')"
y echo "select a.* from a,(select level from dual connect by level <= 399999)" | y banco connIn,hash connOut,hash -outTable a carga
y banco conn,hash select "select count(1) from a"
# 34k linhas/s - table to table
# y banco $conn execute "create table a ( C1 varchar2(3000), C2 varchar2(3000), C3 varchar2(3000) )"
y banco conn,desktop execute "drop table b"
y banco conn,desktop execute "create table b as select * from a where rownum <= 1"
y banco conn,desktop selectInsert "select b.* from b,(select level from dual connect by level <= 160000)" | y banco buffer -n_line 500 -log buffer.log | y banco conn,desktop executeInsert
cat buffer.log
# y banco conn,desktop select "select count(1) from b"
# 65k linhas/s - lendo arquivo
y cat a a a | y banco buffer -n_lines 500 -log buffer.log | y dev_null
cat buffer.log
# 4k linhas/s - gravando arquivo
y cat a | y banco buffer -n_lines 500 -log buffer.log > aa
cat buffer.log
# 34k linhas/s - table to null
y banco conn,desktop selectInsert "select * from a" | y banco buffer -n_lines 500 -log buffer.log | y dev_null
cat buffer.log
# 59k linhas/s - file to table
y banco conn,desktop execute "drop table b"
y banco conn,desktop execute "create table b as select * from a where rownum <= 1"
y cat b | y banco buffer -n_lines 500 -log buffer.log | y banco conn,desktop executeInsert
cat buffer.log
*/
//teste
//y serverRouter 192.168.0.100 8080 localhost 9090 show
//args=new String[]{"serverRouter","192.168.0.100","25565","192.168.0.200","25565","show"};
//args=new String[]{"serverRouter","192.168.0.100","25565","192.168.0.200","25565"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\aa\\a.xlsx","nomeAba","Gestão de Mud (CITSD_change)"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\aa\\a.xlsx","nomeAba","N A (AccountLeads)"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\aa\\a.xlsx","exportAll"};
//args=new String[]{"selectCSV","-csv","c:\\tmp\\tmp\\a.csv","select CAMPO2, CAMPO2 from this"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\aa\\a.xlsx","mostraEstrutura"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\aa\\a.xlsx","numeroAba","1"};
//args=new String[]{"xml","C:\\tmp\\aa\\sheet438.xml","mostraTags"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\tmp\\012020.xlsx","exportAll"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\tmp\\012020.xlsx","numeroAba","1"};
//args=new String[]{"xlsxToCSV","C:\\tmp\\tmp\\012020.xlsx","mostraEstrutura"};
new Y().go(args);
}
public void go(String[] args){
System.setProperty("https.protocols", "TLSv1.1");
try_load_libraries();
try_load_ORAs();
if ( args.length == 0 ){
System.err.println(
somente_mini("/y/manual")
);
return;
}
if ( args[0].equals("banco") ){
if ( args.length == 1 ){
System.err.println(
somente_banco("/y/manual")
);
return;
}
// fromCSV
if ( args.length == 5 && args[1].equals("fromCSV") && args[2].equals("-outTable") && args[4].equals("selectInsert") ){
selectInsert("","","",null,args[3],"");
return;
}
// conn
if ( args[1].equals("-conn") || ( args[1].startsWith("conn,") ) ){
String [] ConnAppParm=getConnAppParm(args);
if ( ConnAppParm == null ){
comando_invalido(args);
return;
}
String conn=ConnAppParm[0];
String app=ConnAppParm[1];
String parm=ConnAppParm[2];
// comandos app
if ( app.equals("select") ){
select(conn,parm);
return;
}
if ( app.equals("selectInsert") ){
selectInsert(conn,"",parm,null,"","");
return;
}
if ( app.equals("selectCSV") ){
selectCSV(conn,parm);
return;
}
if ( app.equals("executeInsert") ){
executeInsert(conn,System.in);
return;
}
if ( app.equals("execute") ){
execute(conn,parm);
return;
}
if ( app.equals("createjobexecute") ){
try{
createjobexecute(conn);
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
return;
}
}
// connIn/fileCSV
if ( args[1].equals("-connIn") || args[1].startsWith("connIn,") || args[1].equals("-fileCSV") || args[1].startsWith("fileCSV,") ){
String [] connIn_fileCSV_connOut_outTable_trunc_app=get_connIn_fileCSV_connOut_outTable_trunc_app(args);
if ( connIn_fileCSV_connOut_outTable_trunc_app == null ){
comando_invalido(args);
return;
}
String connIn=connIn_fileCSV_connOut_outTable_trunc_app[0];
String fileCSV=connIn_fileCSV_connOut_outTable_trunc_app[1];
String connOut=connIn_fileCSV_connOut_outTable_trunc_app[2];
String outTable=connIn_fileCSV_connOut_outTable_trunc_app[3];
String trunc=connIn_fileCSV_connOut_outTable_trunc_app[4];
String app=connIn_fileCSV_connOut_outTable_trunc_app[5];
//[y banco connIn,hash connOut,hash outTable,tabelaA carga]
//[y banco connIn,hash connOut,hash outTable,tabelaA trunc carga]
//[y banco connIn,hash connOut,hash outTable,tabelaA createjobcarga]
//[y banco connIn,hash connOut,hash outTable,tabelaA trunc createjobcarga]
if ( app.equals("carga") )
{
carga(connIn,fileCSV,connOut,outTable,trunc);
return;
}
if ( app.equals("createjobcarga") )
{
try{
createjobcarga(connIn,fileCSV,connOut,outTable,trunc,app);
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
return;
}
}
// executejob
if ( args[1].equals("executejob") && args.length == 2 ){
executejob();
return;
}
// buffer
if ( args[1].equals("buffer")
&& (
( args.length == 2 )
|| ( args.length == 4 && args[2].equals("-n_lines") )
|| ( args.length == 4 && args[2].equals("-log") )
|| ( args.length == 6 && args[2].equals("-n_lines") && args[4].equals("-log") )
)
){
buffer(args);
return;
}
comando_invalido(args);
return;
}
if ( args[0].equals("selectCSV") ){
try{
selectCSV(args);
return;
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
}
if ( args[0].equals("xlsxToCSV") && args.length >= 3 ){
//args=new String[]{"xlsxToCSV","teste.xlsx","mostraEstrutura"};
//args=new String[]{"xlsxToCSV","teste.xlsx","listaAbas"};
//args=new String[]{"xlsxToCSV","teste.xlsx","numeroAba","1"};
//args=new String[]{"xlsxToCSV","teste.xlsx","nomeAba","A"};
try{
if ( new File(args[1]).exists() ){
if ( args.length == 3 && args[2].equals("mostraEstrutura") ){
xlsxToCSV(args[1],true,false,-1,"",System.out,false);
return;
}
if ( args.length == 3 && args[2].equals("listaAbas") ){
xlsxToCSV(args[1],false,true,-1,"",System.out,false);
for ( int i=0;i<xlsxToCSV_nomes.size();i++ )
System.out.println(xlsxToCSV_nomes.get(i));
return;
}
if ( args.length == 3 && args[2].equals("exportAll") ){
xlsxToCSV(args[1],false,true,-1,"",null,false);
ArrayList<String> bkp_lista=xlsxToCSV_nomes;
OutputStream out=null;
boolean suprimeHeader=false;
boolean config_SystemOuput=true;
String abaSequencial=get_abaSequencial(bkp_lista);
if ( abaSequencial != null ){
if ( config_SystemOuput ){
out=System.out;
}else{
System.out.println("exportando "+abaSequencial+".csv");
out=new FileOutputStream(abaSequencial+".csv");
}
for ( int i=0;i<bkp_lista.size();i++ ){
if ( i == 0)
suprimeHeader=false;
else
suprimeHeader=true;
xlsxToCSV(args[1],false,false,-1,bkp_lista.get(i),out,suprimeHeader);
}
if ( out != null ){
out.flush();
out.close();
}
}else{
for ( int i=0;i<bkp_lista.size();i++ ){
System.out.println("exportando("+(i+1)+"/"+bkp_lista.size()+") arquivo: "+bkp_lista.get(i)+".csv");
out=new FileOutputStream(bkp_lista.get(i)+".csv");
xlsxToCSV(args[1],false,false,-1,bkp_lista.get(i),out,false);
if ( out != null ){
out.flush();
out.close();
}
}
}
return;
}
if ( args.length == 4 && args[2].equals("numeroAba") ){
try{
xlsxToCSV(args[1],false,false,Integer.parseInt(args[3]),"",System.out,false);
return;
}catch(Exception e){}
}
if ( args.length == 4 && args[2].equals("nomeAba") && args[3].length() > 0 ){
xlsxToCSV(args[1],false,false,-1,args[3],System.out,false);
return;
}
}
}catch(Exception e){
System.err.println("Erro, "+e.toString());
System.exit(1);
}
}
if ( args[0].equals("xml") && ( args.length == 2 || args.length == 3 ) ){
try{
if ( args.length == 2 && args[1].equals("mostraEstrutura") ){
XML.loadIs(System.in,true,false,null,false,null,false);
return;
}
if ( args.length == 2 && args[1].equals("mostraTags") ){
XML.loadIs(System.in,false,true,null,false,null,false);
return;
}
if ( args.length == 3 && new File(args[1]).exists() && args[2].equals("mostraEstrutura") ){
FileInputStream is = new FileInputStream(args[1]);
XML.loadIs(is,true,false,null,false,null,false);
is.close();
return;
}
if ( args.length == 3 && new File(args[1]).exists() && args[2].equals("mostraTags") ){
FileInputStream is = new FileInputStream(args[1]);
XML.loadIs(is,false,true,null,false,null,false);
is.close();
return;
}
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
}
if ( args[0].equals("token") ){
if ( args.length == 1 ){
System.err.println("usage:"
+ "\n [y token value]"
+ "\n return hash"
+ "\n [y gettoken hash]"
+ "\n return value");
return;
}
String dir_token=getenv();
if ( ! env_ok(dir_token) )
return;
String value=args[1];
String hash=gravado_token(dir_token,value);
if ( hash == null ){
System.err.println("Não foi possível utilizar a pasta "+dir_token);
return;
}
System.out.println(hash);
return;
}
if ( args[0].equals("gettoken") ){
if ( args.length == 1 ){
System.err.println("usage:"
+ "\n [y token value]"
+ "\n return hash"
+ "\n [y gettoken hash]"
+ "\n return value");
return;
}
String value=gettoken(args[1]);
if ( value == null )
{
System.err.println("Não foi possível encontrar o token "+args[1]);
return;
}
System.out.println(value);
return;
}
/*
y zip add File1.txt > saida.zip
cat File1.txt | y zip add -name File1.txt > saida.zip
y zip add /pasta1 > saida.zip
y zip list arquivo.zip
cat arquivo.zip | y zip list
y zip extract entrada.zip
cat entrada.zip | y zip extract
y zip extract entrada.zip -out /destino
cat entrada.zip | y zip extract -out /destino
y zip extractSelected entrada.zip pasta1/unicoArquivoParaExtrair.txt -out /destino
cat entrada.zip | y zip extractSelected pasta1/unicoArquivoParaExtrair.txt -out /destino
y zip extractSelected entrada.zip pasta1/unicoArquivoParaExtrair.txt > /destino/unicoArquivoParaExtrair.txt
cat entrada.zip | y zip extractSelected pasta1/unicoArquivoParaExtrair.txt > /destino/unicoArquivoParaExtrair.txt
*/
if ( args[0].equals("zip") ){
try{
if ( args.length == 2 && args[1].equals("add") ){
zip_add(null,null);
return;
}
if ( args.length == 3 && args[1].equals("add") ){
zip_add(args[2],null);
return;
}
if ( args.length == 4 && args[1].equals("add") && args[2].equals("-name")){
zip_add(null,args[3]);
return;
}
if ( args.length == 2 && args[1].equals("list") ){
zip_list(null);
return;
}
if ( args.length == 3 && args[1].equals("list") ){
zip_list(args[2]);
return;
}
if ( args.length == 2 && args[1].equals("extract") ){
zip_extract(null,null,null);
return;
}
if ( args.length == 3 && args[1].equals("extract") ){
zip_extract(args[2],null,null);
return;
}
if ( args.length == 4 && args[1].equals("extract") && args[2].equals("-out")){
zip_extract(null,args[3],null);
return;
}
if ( args.length == 5 && args[1].equals("extract") && args[3].equals("-out")){
zip_extract(args[2],args[4],null);
return;
}
if ( args.length == 3 && args[1].equals("extractSelected") ){
zip_extract(null,null,args[2]);
return;
}
if ( args.length == 4 && args[1].equals("extractSelected") ){
zip_extract(args[2],null,args[3]);
return;
}
if ( args.length == 5 && args[1].equals("extractSelected") && args[3].equals("-out")){
zip_extract(null,args[4],args[2]);
return;
}
if ( args.length == 6 && args[1].equals("extractSelected") && args[4].equals("-out")){
zip_extract(args[2],args[5],args[3]);
return;
}
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
}
if ( args[0].equals("gzip") ){
gzip();
return;
}
if ( args[0].equals("gunzip") ){
gunzip();
return;
}
if ( args[0].equals("echo") ){
echo(args);
return;
}
if ( args[0].equals("printf") ){
printf(args);
return;
}
if ( args[0].equals("cat") && args.length >= 2 ){
cat(args);
return;
}
if ( args[0].equals("md5") ){
digest("MD5");
return;
}
if ( args[0].equals("sha1") ){
digest("SHA-1");
return;
}
if ( args[0].equals("sha256") ){
digest("SHA-256");
return;
}
if ( args[0].equals("aes") && args.length > 1 ){
String[] senha_isEncoding_md_salt=get_senha_isEncoding_md_salt(args);
if ( senha_isEncoding_md_salt != null ){
aes(senha_isEncoding_md_salt[0],senha_isEncoding_md_salt[1].equals("S"),senha_isEncoding_md_salt[2],senha_isEncoding_md_salt[3]==null?null:hexTobytes(senha_isEncoding_md_salt[3]));
return;
}
}
if ( args[0].equals("base64")
&& (
args.length == 1
|| ( args.length == 2 && args[1].equals("-e") )
|| ( args.length == 2 && args[1].equals("-d") )
|| ( args.length == 3 && args[1].equals("-e") && args[2].length() > 0 )
|| ( args.length == 3 && args[1].equals("-d") && args[2].length() > 0 )
)
){
try{
if ( args.length == 1 ){
base64(System.in,System.out,true);
return;
}
boolean encoding=args[1].equals("-e");
if ( args.length == 2 ){
base64(System.in,System.out,encoding);
return;
}
if ( args.length == 3 ){
System.out.println(
base64(args[2], encoding)
);
return;
}
System.err.println("Erro inesperado!");
System.exit(1);
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
return;
}
if ( args[0].equals("grep") ){
grep(args);
return;
}
if ( args.length == 2 && args[0].equals("wc") && args[1].equals("-l") ){
wc_l();
return;
}
if ( args[0].equals("head")
&& (
args.length == 1
|| ( args.length == 2 && args[1].startsWith("-") && args[1].length() > 1 )
)
){
head(args);
return;
}
if ( args[0].equals("tail")
&& (
args.length == 1
|| ( args.length == 2 && args[1].startsWith("-") && args[1].length() > 1 )
)
){
tail(args);
return;
}
if ( args[0].equals("cut") && args.length == 2 && args[1].startsWith("-c") && args[1].length() > 2 ){
cut(args);
return;
}
if ( args[0].equals("sed") ){
if ( args.length == 3 ){
sed(args);
return;
}
if ( args.length%2 == 1 ){
sedBasic(args);
return;
}
}
if ( args[0].equals("n") ){
n();
return;
}
if ( args[0].equals("rn") ){
rn();
return;
}
if ( args[0].equals("bytesToInts") || args[0].equals("bi") ){
boolean dif_128=false;
if ( args.length > 1 && args[1].equals("-128") )
dif_128=true;
bytesToInts(dif_128);
return;
}
if ( args[0].equals("intsToBytes") || args[0].equals("ib") ){
intsToBytes(args);
return;
}
if ( args[0].equals("od")
&& (
args.length == 1
|| (args.length == 2 && args[1].startsWith("-") && args[1].length() > 1)
)
){
if ( args.length == 1 )
od("");
else
od(args[1].substring(1));
return;
}
if ( args[0].equals("touch") && (args.length == 2 || args.length == 3) ){
touch(args);
return;
}
if ( args[0].equals("M") )
{
if ( args.length == 1 ){
System.out.println("Parametro inválido!");
System.out.println("Modelo:");
System.out.println("y M ClassePrincipal Caminho Senha");
System.out.println("y M pacote1/ClassePrincipal Caminho Senha");
return;
}
if ( args.length == 4 ){
String txt="";
boolean principal_encontrado=false;
String classe="";
String path="";
byte[] data=null;
String principal=args[1].replace("/",".");
String dir=args[2];
String senha=args[3];
// chamada principal
txt=","+principal;
for ( String item : nav_custom(dir) ){
if ( ! item.contains("|") ){
System.err.println("Erro fatal 44");
System.exit(1);
}
classe=item.split("\\|")[0];
path=item.split("\\|")[1];
if ( classe.equals(principal) )
principal_encontrado=true;
try{
data=readAllBytes( path );
}catch(Exception e){
System.out.println("Erro na leitrua do arquivo: "+path+". "+e.toString());
System.exit(1);
}
txt+=","+classe;
try{
txt+=","+base64_B_S(data,true);
}catch(Exception e){
System.out.println("Erro interno!");
System.exit(1);
}
}
if ( !principal_encontrado ){
System.out.println("Erro, classe principal nao encontrada!");
System.exit(1);
}
try{
txt=base64_B_S(new AES().encrypt(txt.getBytes(),senha,null,null) ,true);
}catch(Exception e){
System.out.println("Erro interno!");
System.exit(1);
}
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("public class M {");
System.out.println(" public static void main(String[] args) throws Exception {");
System.out.println(" String M=System.getenv(\"M\");");
System.out.println(" if ( M != null && M.length() > 0 ){");
System.out.println(" try{");
System.out.println(" M=new String( new M_AES().decrypt(M_Base64.base64(M, false),\"\",null) );");
System.out.println(" if ( M_Loader.loader(M,args) )");
System.out.println(" return;");
System.out.println(" }catch(Exception e){");
System.out.println(" System.out.println(e.toString());");
System.out.println(" }");
System.out.println(" System.out.println(\"Acesso negado!\");");
System.out.println(" }");
System.out.println(" pedeSenha();");
System.out.println(" }");
System.out.println(" public static void pedeSenha(){");
System.out.println(" try{");
System.out.println(" String M=M_UtilConsole.getPasswordConsole(\"Digite a senha: \");");
System.out.println(" if ( M == null || M.length() == 0 ){");
System.out.println(" System.out.println(\"Erro, nenhuma senha digitada!\");");
System.out.println(" System.exit(1);");
System.out.println(" }");
System.out.println(" M=M_Base64.base64(new M_AES().encrypt(M.getBytes(),\"\",null,null),true);");
System.out.println(" System.out.println(\"digite o comando export abaixo para ambientes nao windows:\");");
System.out.println(" System.out.println(\"export M=\"+M); ");
System.out.println(" System.out.println(\"digite o comando export abaixo para ambientes windows:\");");
System.out.println(" System.out.println(\"set M=\"+M);");
System.out.println(" System.out.println(\"para debug(ver os loadClass) use export showLoadClass=S ou set showLoadClass=S\");");
System.out.println(" }catch(Exception e){");
System.out.println(" System.out.println(\"Erro interno!\");");
System.out.println(" System.exit(1);");
System.out.println(" }");
System.out.println(" }");
System.out.println("}");
System.out.println("// openssl aes-256-cbc -base64 -pass pass:<secret> -md md5");
System.out.println("// creditos: https://github.com/chmduquesne/minibackup/blob/master/samples/OpensslAES.java");
System.out.println("// new M_AES().encrypt(bytes,password,null,null);");
System.out.println("// new M_AES().decrypt(bytes,password,null);");
System.out.println("class M_AES{ byte [] deriveKeyAndIV(byte[] password, String md, byte[] salt) throws Exception{ if ( md == null || md.equals(\"\") ) md=\"MD5\"; byte[] res = new byte[48]; final java.security.MessageDigest md5 = java.security.MessageDigest.getInstance(md); md5.update(password); md5.update(salt); byte[] hash1 = md5.digest(); md5.reset(); md5.update(hash1); md5.update(password); md5.update(salt); byte[] hash2 = md5.digest(); md5.reset(); md5.update(hash2); md5.update(password); md5.update(salt); byte[] hash3 = md5.digest(); if ( md == null || md.equals(\"MD5\")){ System.arraycopy(hash1, 0, res, 0, 16); System.arraycopy(hash2, 0, res, 16, 16); System.arraycopy(hash3, 0, res, 32, 16); }else{ System.arraycopy(hash1, 0, res, 0, 32); System.arraycopy(hash2, 0, res, 32, 16); } return res; } public void encrypt(java.io.InputStream pipe_in, java.io.OutputStream pipe_out, String senha, String md, byte[] salt) throws Exception { byte[] salt_ = new byte[8]; java.security.SecureRandom sr = new java.security.SecureRandom(); sr.nextBytes(salt_); if ( salt==null ) salt=salt_; byte[] keyAndIV = deriveKeyAndIV(senha.getBytes(),md,salt); byte[] key = java.util.Arrays.copyOfRange(keyAndIV, 0, 32); byte[] iv = java.util.Arrays.copyOfRange(keyAndIV, 32, 48); javax.crypto.spec.SecretKeySpec skeySpec = new javax.crypto.spec.SecretKeySpec(key, \"AES\"); javax.crypto.spec.IvParameterSpec ivspec = new javax.crypto.spec.IvParameterSpec(iv); javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance(\"AES/CBC/PKCS5Padding\"); cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, skeySpec, ivspec); int BUFFER_SIZE=1024; byte[] buff=new byte[BUFFER_SIZE]; int len=0; pipe_out.write(\"Salted__\".getBytes()); pipe_out.write(salt); while ( (len=pipe_in.read(buff,0,BUFFER_SIZE)) > 0 ) pipe_out.write( cipher.update(buff,0,len) ); pipe_out.write(cipher.doFinal()); pipe_out.flush(); } public byte[] encrypt(byte[] data, String senha, String md, byte[] salt) throws Exception{ java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(data); java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); encrypt(bais,baos,senha,md,salt); return baos.toByteArray(); } public void decrypt(java.io.InputStream pipe_in,java.io.OutputStream pipe_out,String senha,String md) throws Exception { int p=0; p=pipe_in.read(new byte[8]); if ( p != 8 ){ System.err.println(\"Erro fatal 0!\"); System.exit(1); } byte[] salt=new byte[8]; p=pipe_in.read(salt); if ( p != 8 ){ System.err.println(\"Erro fatal 0!\"); System.exit(1); } byte[] keyAndIV=deriveKeyAndIV(senha.getBytes(),md,salt); byte[] key=java.util.Arrays.copyOfRange(keyAndIV, 0, 32); byte[] iv=java.util.Arrays.copyOfRange(keyAndIV, 32, 48); javax.crypto.spec.SecretKeySpec skeySpec = new javax.crypto.spec.SecretKeySpec(key, \"AES\"); javax.crypto.spec.IvParameterSpec ivspec = new javax.crypto.spec.IvParameterSpec(iv); javax.crypto.Cipher cipher; cipher=javax.crypto.Cipher.getInstance(\"AES/CBC/PKCS5Padding\"); cipher.init(javax.crypto.Cipher.DECRYPT_MODE, skeySpec, ivspec); int BUFFER_SIZE=1024; byte[] buff=new byte[BUFFER_SIZE]; int len=0; while ( (len=pipe_in.read(buff,0,BUFFER_SIZE)) > 0 ) pipe_out.write( cipher.update(buff,0,len) ); pipe_out.write(cipher.doFinal()); pipe_out.flush(); } public byte[] decrypt(byte[] data, String senha, String md) throws Exception{ java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(data); java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); decrypt(bais,baos,senha,md); return baos.toByteArray(); } private static String bytesToHex(byte[] a){ StringBuilder sb = new StringBuilder(); for (byte b : a) { sb.append(String.format(\"%02X\", b)); } return sb.toString(); } private static byte[] hexTobytes(String s) { int len = s.length(); byte[] data = new byte[len / 2]; for (int i = 0; i < len; i += 2) { data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i+1), 16)); } return data;}}");
System.out.println("// M_Base64.base64(bytes,true) // retorna string encriptado");
System.out.println("// M_Base64.base64(texto,false) // retorna bytes decriptado");
System.out.println("class M_Base64{ public static String erroSequenciaIlegal=\"Erro, sequencia ilegal!\"; public static int [] indexBase64 = new int []{65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47}; public static String txtBase64=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"; public static byte[] base64(String txt,boolean encoding) throws Exception{ java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(txt.getBytes()); java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); base64(bais,baos,encoding); return baos.toByteArray(); } public static String base64(byte[] bytes,boolean encoding) throws Exception{ java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(bytes); java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); base64(bais,baos,encoding); return baos.toString(); } public static void base64(java.io.InputStream pipe_in,java.io.OutputStream pipe_out,boolean encoding) throws Exception{ if ( encoding ) base64encode(pipe_in,pipe_out); else base64decode(pipe_in,pipe_out); } public static void base64encode(java.io.InputStream pipe_in,java.io.OutputStream pipe_out) throws Exception{ int BUFFER_SIZE_ = 1; byte [] buf=new byte[BUFFER_SIZE_]; int len=-1; int entrada=-1; int agulha=0; int agulha_count=0; int indexPadding=61; while(true){ while( (len=pipe_in.read(buf,0,BUFFER_SIZE_)) == 0 ){} if ( len == -1 ){ if ( agulha_count == 4 ){ pipe_out.write( indexBase64[ agulha<<2 ] ); pipe_out.write( indexPadding ); } if ( agulha_count == 2 ){ pipe_out.write( indexBase64[ agulha<<4 ] ); pipe_out.write( indexPadding ); pipe_out.write( indexPadding ); } break; } entrada=byte_to_int_java(buf[0]); agulha=(agulha<<8)|entrada; agulha_count+=8; while(agulha_count>=6){ if ( agulha_count == 6 ){ pipe_out.write( indexBase64[ agulha ] ); agulha=0; agulha_count-=6; continue; } if ( agulha_count == 8 ){ pipe_out.write( indexBase64[ (agulha & 252)>>2 ] ); agulha&=3; agulha_count-=6; continue; } if ( agulha_count == 10 ){ pipe_out.write( indexBase64[ (agulha & 1008)>>4 ] ); agulha&=15; agulha_count-=6; continue; } if ( agulha_count == 12 ){ pipe_out.write( indexBase64[ (agulha & 4032)>>6 ] ); agulha&=63; agulha_count-=6; continue; } } } pipe_out.flush(); } public static void base64decode(java.io.InputStream pipe_in,java.io.OutputStream pipe_out) throws Exception{ int BUFFER_SIZE_ = 1; byte [] buf=new byte[BUFFER_SIZE_]; int len=-1; int entrada=-1; int agulha=0; int agulha_count=0; int padding_count=0; while(true){ while( (len=pipe_in.read(buf,0,BUFFER_SIZE_)) == 0 ){} if ( len == -1 ){ if ( agulha_count == 0 && padding_count == 0 && agulha == 0 ){ break; } if ( agulha_count == 4 && padding_count == 2 && agulha == 0 ){ break; } if ( agulha_count == 2 && padding_count == 1 && agulha == 0 ){ break; } throw new Exception(erroSequenciaIlegal); } entrada=byte_to_int_java(buf[0]); if ( entrada == 10 || entrada == 13 ) continue; entrada=txtBase64.indexOf((char)entrada); if ( entrada == -1 ){ System.err.println(erroSequenciaIlegal); System.exit(1); } if ( entrada == 64 ){ padding_count++; continue; } agulha=(agulha<<6)|entrada; agulha_count+=6; while(agulha_count>=8){ if ( agulha_count == 8 ){ pipe_out.write( agulha ); agulha=0; agulha_count-=8; continue; } if ( agulha_count == 10 ){ pipe_out.write( (agulha & 1020)>>2 ); agulha&=3; agulha_count-=8; continue; } if ( agulha_count == 12 ){ pipe_out.write( (agulha & 4080)>>4 ); agulha&=15; agulha_count-=8; continue; } } } pipe_out.flush(); } public static int byte_to_int_java(byte a) { int i=(int)a; if ( i < 0 ) i+=256; return i;}}");
System.out.println("// String senha=M_UtilConsole.getPasswordConsole(\"Digite a senha: \");");
System.out.println("// String texto=M_UtilConsole.getTextConsole(\"Digite o texto: \");");
System.out.println("class M_UtilConsole{ public static String getPasswordConsole(String txt) { String retorno=\"\"; java.io.Console console=System.console(); if ( console == null ){ System.out.println(\"Error, input nao suportado nesse ambiente, rodando no netbeans?...\"); System.exit(1); } char [] passChar = System.console().readPassword(txt); if ( passChar != null ) retorno=new String(passChar); if ( retorno == null ){ System.out.println(\"Error, not input found\"); System.exit(1); } return retorno;}public static String getTextConsole(String txt) { String retorno=\"\"; java.io.Console console=System.console(); if ( console == null ){ System.out.println(\"Error, input nao suportado nesse ambiente, rodando no netbeans?...\"); System.exit(1); } System.out.print(txt);retorno=System.console().readLine();if ( retorno == null ){ System.out.println(\"Error, not input found\"); System.exit(1); } return retorno;}}");
System.out.println("//M_Loader");
System.out.println("//[classe principal],[load classA] ,[load classB] ");
System.out.println("//,classA ,classA,dados...,classB,dados...");
System.out.println("class M_Loader{ public static boolean loader(String senha,String[] args) throws Exception { String showLoadClass_txt=System.getenv(\"showLoadClass\"); boolean showLoadClass=showLoadClass_txt != null && showLoadClass_txt.equals(\"S\"); try{ if ( showLoadClass ) System.out.println(\"showLoadClass...\"); java.util.HashMap classes=new java.util.HashMap(); String base=M_Dados.get(); String txt=new String( new M_AES().decrypt( M_Base64.base64(base,false) ,senha,null) ); if (!txt.startsWith(\",\")){ throw new Exception(\"Erro fatal!\"); }else{ txt=txt.substring(1); } String partes[]=txt.split(\",\"); String id=null; String principal=null; for ( int i=0;i<partes.length;i++ ){ if ( principal == null ){ principal=partes[i]; continue; } if ( id == null ){ id=partes[i]; continue; } classes.put(id,partes[i]); id=null; } ClassLoader classLoader=new ClassLoader() { @Override protected Class<?> findClass(String name) throws ClassNotFoundException { if ( classes.containsKey(name) ){ try { byte[] data=M_Base64.base64((String)classes.get(name),false); if ( showLoadClass ) System.out.println(\"showLoadClass...loadClasse...\"+name); return defineClass(name,data,0,data.length); } catch (Exception e) { System.err.println(\"Erro no carregamento da classe \"+name); System.exit(1); } } if ( showLoadClass ) System.out.println(\"showLoadClass...loadClasseNative...\"+name); return super.findClass(name); } }; Class c=classLoader.loadClass(principal); java.lang.reflect.Method method=c.getDeclaredMethod(\"main\", String[].class ); method.invoke(null, new Object[]{ args } ); }catch(Exception e){ return false;} return true;} }");
int len=txt.length();
int method_len=1;
int cont=0;
int cont_len=1000;
// methods
System.out.println("class M_Dados_"+method_len+" {");
System.out.println(" public static String get(){");
System.out.println(" StringBuilder sb=new StringBuilder();");
for ( int i=0;i<len;i+=200 ){
if ( cont > cont_len ){
cont=0;
method_len++;
System.out.println(" return sb.toString();");
System.out.println(" }");
System.out.println("}");
System.out.println("class M_Dados_"+method_len+" {");
System.out.println(" public static String get(){");
System.out.println(" StringBuilder sb=new StringBuilder();");
}
if ( i+200 > len )
System.out.println(" sb.append(\""+txt.substring(i,len)+"\");");
else
System.out.println(" sb.append(\""+txt.substring(i,i+200)+"\");");
cont++;
}
System.out.println(" return sb.toString();");
System.out.println(" }");
System.out.println("}");
//finish
System.out.println("//M_Dados");
System.out.println("class M_Dados {");
System.out.println(" public static String get(){");
for ( int i=1;i<=method_len;i++ ){
if ( i == 1 && method_len == 1 ){
System.out.println(" return M_Dados.get_1();");
}else{
if ( i == 1 ){
System.out.println(" return M_Dados_1.get()");
}else{
if ( i < method_len ){
System.out.println(" + M_Dados_"+i+".get()");
}else{
System.out.println(" + M_Dados_"+i+".get();");
}
}
}
}
System.out.println(" }");
System.out.println("}");
return;
}
}
if ( args[0].equals("iconv") ){
if ( args.length == 1 ){
System.out.println("Tipos suportados de iconv:");
for(int i=0;i<suportIconv.length;i++)
System.out.println(" "+suportIconv[i]);
System.out.println("Ex:");
System.out.println("y iconv -f UTF-8 -t ISO-8859-1 file");
return;
}
if (
( args.length == 5 || args.length == 6 )
&& ( (args[1].equals("-f") && args[3].equals("-t")) || (args[1].equals("-t") && args[3].equals("-f")) )
&& isSuportIconv(args[2]) && isSuportIconv(args[4]) && ! args[2].equals(args[4])
){
String file_=null;
if ( args.length == 6 ){
if ( ! new File(args[5]).exists() ){
System.err.println("Erro, este arquivo não existe: "+args[5]);
System.exit(1);
}
file_=args[5];
}
String tipoOrigem=args[2];
String tipoDestino=args[4];
if ( args[1].equals("-t") ){
tipoOrigem=args[4];
tipoDestino=args[2];
}
// tipo em BOM(puro)
String tipoOrigemPuro=tipoOrigem.endsWith("BOM")?tipoOrigem.substring(0, tipoOrigem.length()-3):tipoOrigem;
String tipoDestinoPuro=tipoDestino.endsWith("BOM")?tipoDestino.substring(0, tipoDestino.length()-3):tipoDestino;
try{
iconv(tipoOrigem,tipoOrigemPuro,tipoDestino,tipoDestinoPuro,file_);
}catch(Exception e){
System.out.println(e.toString());
System.exit(1);
}
return;
}
}
if ( args[0].equals("tee") && args.length == 2 ){
tee(args[1]);
return;
}
if ( args[0].equals("uniq") ){
uniq_quebra(false);
return;
}
if ( args[0].equals("quebra") ){
uniq_quebra(true);
return;
}
if ( args[0].equals("seq") ){
try{
if ( args.length == 3 ){
seq(Integer.parseInt(args[1]),Integer.parseInt(args[2]),0);
return;
}
if ( args.length == 4 ){
seq(Integer.parseInt(args[1]),Integer.parseInt(args[2]),Integer.parseInt(args[3]));
return;
}
}catch(Exception e){}
}
if ( args[0].equals("awk") )
{
if ( args.length >= 3 && args[1].equals("print") )
{
awk_print(args);
return;
}
awk_start_end(args);
return;
}
if ( args[0].equals("dev_null") ){
dev_null();
return;
}
if ( args[0].equals("dev_in") ){
dev_in();
return;
}
if ( args[0].equals("scp") ){
scp(args);
return;
}
if ( args[0].equals("execSsh") ){
execSsh(args);
return;
}
if ( args[0].equals("ssh") ){
ssh(args);
return;
}
if ( args[0].equals("sftp") ){
sftp(args);
return;
}
if ( args[0].equals("serverRouter"))
{
serverRouter(args);
return;
}
if ( args[0].equals("TESTEserver"))
{
TESTEserver(args);
return;
}
if ( args[0].equals("TESTEclient"))
{
TESTEclient(args);
return;
}
if ( args[0].equals("httpServer"))
{
if ( args.length == 8 ){
new HttpServer(new String[]{args[1],args[2],args[3],args[4],args[5],args[6],args[7]});
return;
}
if ( args.length == 1 ){
new HttpServer(new String[]{"localhost","tmp","tmp","8888",".","",""});
return;
}
}
if ( args[0].equals("wget"))
{
wget(args);
return;
}
if ( args[0].equals("help") || args[0].equals("-help") || args[0].equals("--help") ){
String retorno=null;
if ( args.length == 2 )
retorno=helplike(args[1]);
if ( retorno == null )
System.err.println(
"Utilitário Y versão:" + lendo_arquivo_pacote("/y/versao") + "\n"
+ lendo_arquivo_pacote("/y/manual")
+ "\n\nUtilitário Y versão:" + lendo_arquivo_pacote("/y/versao")
);
else
System.err.println(
retorno
);
return;
}
comando_invalido(args);
return;
}
public String [] getConnAppParm(String [] args){
//[y banco -conn ... select]
//[y banco -conn ... select select..]
//[y banco -conn ... selectInsert]
//[y banco -conn ... selectInsert select..]
//[y banco -conn ... selectCSV]
//[y banco -conn ... selectCSV select..]
//[y banco -conn ... executeInsert]
//[y banco -conn ... execute]
//[y banco -conn ... execute execute..]
//[y banco conn,hash select]
//[y banco conn,hash select select..]
//[y banco conn,hash selectInsert]
//[y banco conn,hash selectInsert select..]
//[y banco conn,hash selectCSV]
//[y banco conn,hash selectCSV select..]
//[y banco conn,hash executeInsert]
//[y banco conn,hash execute]
//[y banco conn,hash execute execute..]
String value_=""; // tmp
String conn="";
String app="";
String parm="";
if ( args.length > 0 && args[0].equals("banco") )
args=sliceParm(1,args);
if ( args.length > 0 && args[0].startsWith("conn,") )
{
value_=gettoken(args[0].split(",")[1]);
if ( value_ == null )
{
System.err.println("Não foi possível encontrar o token "+args[0].split(",")[1]);
return null;
}
conn=value_;
if ( ! conn.equals(":")){
try{
conn=base64_S_S(conn,false);
}catch(Exception e){}
}
conn=conn.replace("\n","");
args=sliceParm(1,args);
}
if ( conn.equals("") && args.length > 1 && args[0].equals("-conn") )
{
conn=args[1];
args=sliceParm(2,args);
}
if ( args.length > 0 )
{
app=args[0];
args=sliceParm(1,args);
}
if ( args.length > 0 )
{
parm=args[0];
args=sliceParm(1,args);
}
if ( conn.equals("") || app.equals("") ) // parm é opcional
return null;
return new String[]{conn,app,parm};
}
public String [] get_connIn_fileCSV_connOut_outTable_trunc_app(String [] args){
//[y banco connIn,hash connOut,hash outTable,tabelaA carga]
//[y banco connIn,hash connOut,hash outTable,tabelaA trunc carga]
//[y banco connIn,hash connOut,hash outTable,tabelaA createjobcarga]
//[y banco connIn,hash connOut,hash outTable,tabelaA trunc createjobcarga]
String value_=""; // tmp
String connIn="";
String fileCSV="";
String connOut="";
String outTable="";
String trunc="";
String createTable=""; // o valor irá para trunc
String app="";
if ( args.length > 0 && args[0].equals("banco") )
args=sliceParm(1,args);
if ( args.length > 0 && args[0].startsWith("connIn,") )
{
value_=gettoken(args[0].split(",")[1]);
if ( value_ == null )
{
System.err.println("Não foi possível encontrar o token "+args[0].split(",")[1]);
return null;
}
connIn=value_;
args=sliceParm(1,args);
}
if ( connIn.equals("") && args.length > 1 && args[0].equals("-connIn") )
{
connIn=args[1];
args=sliceParm(2,args);
}
if ( args.length > 0 && args[0].startsWith("fileCSV,") )
{
value_=gettoken(args[0].split(",")[1]);
if ( value_ == null )
{
System.err.println("Não foi possível encontrar o token "+args[0].split(",")[1]);
return null;
}
fileCSV=value_;
args=sliceParm(1,args);
}
if ( connIn.equals("") && args.length > 1 && args[0].equals("-fileCSV") )
{
fileCSV=args[1];
args=sliceParm(2,args);
}
if ( args.length > 0 && args[0].startsWith("connOut,") )
{
value_=gettoken(args[0].split(",")[1]);
if ( value_ == null )
{
System.err.println("Não foi possível encontrar o token "+args[0].split(",")[1]);
return null;
}
connOut=value_;
args=sliceParm(1,args);
}
if ( args.length > 1 && connOut.equals("") && args[0].equals("-connOut") )
{
connOut=args[1];
args=sliceParm(2,args);
}
if ( args.length > 0 && args[0].startsWith("outTable,") )
{
value_=gettoken(args[0].split(",")[1]);
if ( value_ == null )
{
System.err.println("Não foi possível encontrar o token "+args[0].split(",")[1]);
return null;
}
outTable=value_;
args=sliceParm(1,args);
}
if ( outTable.equals("") && args.length > 1 && args[0].equals("-outTable") )
{
outTable=args[1];
args=sliceParm(2,args);
}
if ( args.length > 0 && args[0].equals("trunc") ){
trunc="S";
args=sliceParm(1,args);
}
if ( args.length > 0 && args[0].equals("createTable") ){
createTable="CREATETABLE";
args=sliceParm(1,args);
}
if ( args.length == 1 ){
app=args[0];
args=sliceParm(1,args);
}
if ( ! trunc.equals("") && ! createTable.equals("") )
return null;
if ( ! createTable.equals("") )
trunc=createTable;
if ( trunc.equals("") )
trunc="N";
if ( (connIn.equals("") && fileCSV.equals("")) || (!connIn.equals("") && !fileCSV.equals("")) )
return null;
if ( connOut.equals("") || outTable.equals("") || trunc.equals("") || app.equals("") )
return null;
return new String[]{connIn,fileCSV,connOut,outTable,trunc,app};
}
public ArrayList<String> get_v_i_txt(String [] args){
String v="N";
String i="N";
String txt="";
ArrayList<String> lista=new ArrayList<String>();
if ( args.length > 0 && args[0].equals("grep") )
args=sliceParm(1,args);
// parametros -v -i
if ( args.length > 2 && args[0].equals("-v") && args[1].equals("-i") ){
v="S";
i="S";
args=sliceParm(2,args);
}else{
if ( args.length > 2 && args[0].equals("-i") && args[1].equals("-v") ){
i="S";
v="S";
args=sliceParm(2,args);
}else{
if ( args.length > 1 && args[0].equals("-v") ){
v="S";
args=sliceParm(1,args);
}else{
if ( args.length > 1 && args[0].equals("-i") ){
i="S";
args=sliceParm(1,args);
}
}
}
}
lista.add(v);
lista.add(i);
while(args.length > 0){
String starting="N";
String ending="N";
txt=args[0];
if ( i.equals("S") )
txt=txt.toUpperCase();
if ( txt.startsWith("^") ){
txt=txt.substring(1);
starting="S";
}
if ( txt.endsWith("$") ){
txt=txt.substring(0,txt.length()-1);
ending="S";
}
lista.add(starting);
lista.add(ending);
lista.add(txt);
args=sliceParm(1,args);
}
return lista;
}
public String[] get_csvFile_sqlFile_sqlText(String[] args) {
String csvFile="";
String sqlFile="";
String sqlText="";
if ( args.length > 0 && args[0].equals("selectCSV") )
args=sliceParm(1,args);
if ( args.length > 1 && args[0].equals("-csv") ){
csvFile=args[1];
args=sliceParm(2,args);
}
if ( args.length > 1 && args[0].equals("-sql") ){
sqlFile=args[1];
args=sliceParm(2,args);
}
if ( args.length == 1 ){
sqlText=args[0];
args=sliceParm(1,args);
}
if ( sqlFile.equals("") && sqlText.equals("") )
return null;
if ( !sqlFile.equals("") && !sqlText.equals("") )
return null;
return new String[]{csvFile,sqlFile,sqlText};
}
public String [] get_senha_isEncoding_md_salt(String [] args){
String senha=null;
String isEncoding="S";
String md=null;
String salt=null;
if ( args.length > 0 && args[0].equals("aes") )
args=sliceParm(1,args);
if ( args.length > 0 && ( args[0].equals("-e") || args[0].equals("-d") ) ){
if ( args[0].equals("-e") )
isEncoding="S";
if ( args[0].equals("-d") )
isEncoding="N";
args=sliceParm(1,args);
}
if ( args.length > 0 ){
senha=args[0];
args=sliceParm(1,args);
}
if ( args.length > 1 && args[0].equals("-md") ){
if ( args[1].toUpperCase().equals("MD5") || args[1].toUpperCase().equals("SHA256") || args[1].toUpperCase().equals("SHA-256") ){
args=sliceParm(1,args);
md=args[0].toUpperCase();
args=sliceParm(1,args);
if ( md.equals("SHA256") )
md="SHA-256";
}
}
if ( args.length > 1 && args[0].equals("-S") ){
args=sliceParm(1,args);
salt=args[0];
args=sliceParm(1,args);
if ( salt.length() != 16 || !isHex(salt) ){
System.err.println("Erro, conteudo hex do Salt inválido: "+salt);
System.exit(1);
}
}
if ( args.length > 0 ){
return null;
}
if ( senha==null )
return null;
return new String[]{senha,isEncoding,md,salt};
}
private boolean isHex(String a){
String tmp="0123456789ABCDEF";
for ( int i=0;i<a.length();i++ )
if ( tmp.indexOf(a.substring(i,i+1)) == -1 )
return false;
return true;
}
private String[] getNegativaStartEnd(String[] args) {
String negativa="N";
String start=null;
String end=null;
if ( args.length > 0 && args[0].equals("awk") )
args=sliceParm(1,args);
if ( args.length > 0 && args[0].equals("-v") ){
negativa="S";
args=sliceParm(1,args);
}
if ( args.length > 1 && args[0].equals("start") )
{
start=args[1];
args=sliceParm(2,args);
}
if ( args.length > 1 && args[0].equals("end") )
{
end=args[1];
args=sliceParm(2,args);
}
if ( args.length == 0 ){
return null;
}
if ( start == null && end == null ){
return null;
}
return new String[]{negativa,start,end};
}
public void select(String conn,String parm){
String parm_=parm;
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
// configuracao TZ UTC NATAL
String dataT=" ";
String dataZ=" ";
boolean flag_natal=false;
String format_data=System.getenv("FORMAT_DATA_Y");
if ( format_data != null && format_data.equals("TZ") ){
dataT="T";
dataZ="Z";
}
if ( format_data != null && format_data.equals("UTC") )
dataZ=" UTC";
if ( format_data != null && format_data.equals("NATAL") )
flag_natal=true;
try{
con = getcon(conn);
if ( con == null ){
System.err.println("Não foi possível se conectar!!" );
return;
}
if ( parm.equals("") ){
String line;
while( (line=readLine()) != null )
parm+=line+"\n";
closeLine();
}
parm=removePontoEVirgual(parm);
stmt = con.createStatement();
rs=null;
ResultSetMetaData rsmd;
ArrayList<String> campos=new ArrayList<String>();
ArrayList<Integer> tipos=new ArrayList<Integer>();
StringBuilder sb=null;
String tmp="";
rs=stmt.executeQuery(parm);
rsmd=rs.getMetaData();
for ( int i=1;i<=rsmd.getColumnCount();i++ )
{
campos.add(rsmd.getColumnName(i));
tipos.add(rsmd.getColumnType(i));
}
while ( rs.next() ){
sb=new StringBuilder();
for ( int i=0;i<campos.size();i++ ){
tmp=rs.getString(campos.get(i));
if ( tmp == null ){
if ( i == campos.size()-1 )
{
sb.append("null");
}else{
sb.append("null\t");
}
continue;
}
if ( tipo_cadastrado(tipos.get(i)) ){
if ( tipo_numerico(tipos.get(i)) && tmp.startsWith("."))
tmp="0"+tmp;
if ( tipos.get(i) == 93 ) // DATA
if ( flag_natal )
tmp="25/12/"+tmp.substring(0, 4)+dataT+tmp.substring(11, 19)+dataZ;
else
tmp=tmp.substring(8, 10)+"/"+tmp.substring(5, 7)+"/"+tmp.substring(0, 4)+dataT+tmp.substring(11, 19)+dataZ;
//tmp=tmp.replace("'","''"); // nao usado no select
if ( i == campos.size()-1 ){
sb.append(tmp);
}else{
sb.append(tmp);
sb.append("\t");
}
continue;
}
throw new Exception("tipo desconhecido:"+tipos.get(i) + " -> " + rs.getString(campos.get(i)) );
}
System.out.println(sb.toString());
}
}
catch(Exception e)
{
System.err.println("Erro: "+e.toString()+" -> "+parm_);
}
close(rs,stmt,con);
}
public void selectInsert(String conn,String fileCSV,String parm, PipedOutputStream out,String table,String nemVouExplicar){ // table opcional
if ( ! conn.equals("") )
{
pipeSelectInsertConn(conn,fileCSV,parm, out,table,nemVouExplicar);
}else{
pipeSelectInsertCSV(conn,fileCSV,parm, out,table,nemVouExplicar);
}
}
public void pipeSelectInsertConn(String conn,String fileCSV,String parm, PipedOutputStream out,String table,String nemVouExplicar){ // table opcional
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
// configuracao TZ UTC NATAL
String dataT=" ";
String dataZ=" ";
boolean flag_natal=false;
String format_data=System.getenv("FORMAT_DATA_Y");
if ( format_data != null && format_data.equals("TZ") ){
dataT="T";
dataZ="Z";
}
if ( format_data != null && format_data.equals("UTC") )
dataZ=" UTC";
if ( format_data != null && format_data.equals("NATAL") )
flag_natal=true;
int countCommit=0;
try{
con = getcon(conn);
if ( con == null ){
System.err.println("Não foi possível se conectar!!" );
return;
}
if ( parm.equals("") ){
String line;
while( (line=readLine()) != null )
parm+=line+"\n";
closeLine();
}
parm=removePontoEVirgual(parm);
stmt = con.createStatement();
rs=null;
ResultSetMetaData rsmd;
ArrayList<String> campos=new ArrayList<String>();
ArrayList<Integer> tipos=new ArrayList<Integer>();
StringBuilder sb=null;
String tmp="";
rs=stmt.executeQuery(parm);
rsmd=rs.getMetaData();
if ( table.equals("") )
table=getTableByParm(parm);
for ( int i=1;i<=rsmd.getColumnCount();i++ )
{
campos.add(rsmd.getColumnName(i));
tipos.add(rsmd.getColumnType(i));
}
while ( rs.next() ){
sb=new StringBuilder();
for ( int i=0;i<campos.size();i++ ){
tmp=rs.getString(campos.get(i));
if ( tmp == null ){
if ( i == campos.size()-1 )
{
sb.append("''");
}else{
sb.append("'',");
}
continue;
}
if ( tipo_cadastrado(tipos.get(i)) ){
if ( tipo_numerico(tipos.get(i)) && tmp.startsWith("."))
tmp="0"+tmp;
if ( tipos.get(i) == 93 ) // DATA
if ( flag_natal )
tmp="to_date('25/12/"+tmp.substring(0, 4)+dataT+tmp.substring(11, 19)+dataZ+"','DD/MM/YYYY HH24:MI:SS')";
else
tmp="to_date('"+tmp.substring(8, 10)+"/"+tmp.substring(5, 7)+"/"+tmp.substring(0, 4)+dataT+tmp.substring(11, 19)+dataZ+"','DD/MM/YYYY HH24:MI:SS')";
if ( tmp.length() <= 4000 ){
if ( tipos.get(i) == 93 ){ // DATA
sb.append(tmp);
}else{
sb.append("'");
sb.append(tmp.replace("'","''"));
sb.append("'");
}
}else{
tmp=formatacaoInsertClobComAspetas(tmp);
sb.append(tmp);
}
if ( i != campos.size()-1 )
sb.append(",");
continue;
}
close(rs,stmt,con);
throw new Exception("tipo desconhecido:"+tipos.get(i) + " -> " + rs.getString(campos.get(i)) );
}
if ( out == null )
System.out.println("insert into "+table+" values("+ sb.toString()+");");
else
out.write( ("insert into "+table+" values("+ sb.toString()+");\n").getBytes() );
if ( countCommit++ >= 10000 ){
if ( out == null )
System.out.println("commit;");
else
out.write("commit;\n".getBytes());
countCommit=0;
}
}
}
catch(Exception e)
{
System.err.println("Erro: "+e.toString()+" -> "+parm);
close(rs,stmt,con);
System.exit(1);
}
close(rs,stmt,con);
}
public void pipeSelectInsertCSV(String conn,String fileCSV,String parm, PipedOutputStream out,String table,String nemVouExplicar){ // table opcional
/*
Estrutura CSV padrao:
HEADER_CAMPO1;BB;CC;3;4;5;
11;;";;""""""11';;";55;55;55
11;;";;""""""11';;";55;55;55
11;;";;""""""11';;";55;55;55;
33;44
33;44
33;44;44;44;44;44;44;44;44;44;44;44;44;44;44;44
33;44;44;44;44;44;44;44;44;44;44;44;44;44;44;44
obs: campos além do headr nao serão considerados
*/
int countCommit=0;
try{
if ( ! fileCSV.equals("") )
readLine(fileCSV);
String line;
String [] camposCSV=null;
int qntCamposCSV=0;
String valorColuna=null;
StringBuilder sb=null;
while ( (line=readLine()) != null ){
if ( qntCamposCSV == 0 )
{
camposCSV=getCamposCSV(line);
qntCamposCSV=camposCSV.length;
if ( ! nemVouExplicar.equals("") ){
String create=getCreateByCamposCSV(camposCSV,table);
if ( ! execute(nemVouExplicar, create) )
return;
}
continue;
}
if ( line.trim().equals("") && qntCamposCSV > 1 )
break;
sb=new StringBuilder();
readColunaCSV(line); // init linhaCSV
for ( int i=0;i<qntCamposCSV;i++ ){
if ( linhaCSV != null ){
valorColuna=readColunaCSV();
if ( valorColuna == null )
linhaCSV=null; // nao precisar ler mais nada
}
if ( valorColuna == null )
sb.append("''");
else
sb.append("'"+valorColuna.replace("'","''").replace("\"\"","\"")+"'");
if ( i != qntCamposCSV-1 )
sb.append(",");
}
if ( out == null )
System.out.println("insert into "+table+" values("+ sb.toString()+");");
else
out.write( ("insert into "+table+" values("+ sb.toString()+");\n").getBytes() );
if ( countCommit++ >= 10000 ){
if ( out == null )
System.out.println("commit;");
else
out.write("commit;\n".getBytes());
countCommit=0;
}
}
closeLine();
}
catch(Exception e)
{
if ( ! fileCSV.equals("") )
System.err.println("Erro: "+e.toString());
else
System.err.println("Erro: "+e.toString()+" file:"+fileCSV);
System.exit(1);
}
}
// comando "y selectCSV"(nao confundir com "y banco selectCSV")
public String [] selectCSV_camposName=null;
public String [] selectCSV_camposValue=null;
public String [] selectCSV_camposNameSaida=null;
public String [] selectCSV_camposNameSaidaAlias=null;
public String [] selectCSV_tratativasWhere=null;
public void selectCSV(String[] args) throws Exception {
String [] csvFile_sqlFile_sqlText=get_csvFile_sqlFile_sqlText(args);
if ( csvFile_sqlFile_sqlText == null ){
comando_invalido(args);
return;
}
String csvFile=csvFile_sqlFile_sqlText[0];
String sqlFile=csvFile_sqlFile_sqlText[1];
String sqlText=csvFile_sqlFile_sqlText[2];
OutputStream out=System.out;
if ( !sqlFile.equals("") ){
String line=null;
sqlText="";
readLineB(sqlFile);
while ( (line=readLineB()) != null )
sqlText+=line+" ";
closeLineB();
}
if ( sqlText.equals("") ){ // trava de segurança
comando_invalido(args);
return;
}
try{
if ( ! csvFile.equals("") )
readLine(csvFile);
String line;
int qntCamposCSV=0;
String valorColuna=null;
while ( (line=readLine()) != null ){
// tratando header
if ( qntCamposCSV == 0 )
{
selectCSV_camposName=getCamposCSV(line);
qntCamposCSV=selectCSV_camposName.length;
selectCSV_camposValue=new String[selectCSV_camposName.length];
interpretaSqlParaSelectCSV(sqlText);
StringBuilder sb=new StringBuilder();
for ( int i=0;i<selectCSV_camposNameSaidaAlias.length;i++ ){
sb.append("\"");
sb.append(selectCSV_camposNameSaidaAlias[i]);
if ( i < selectCSV_camposNameSaidaAlias.length-1 )
sb.append("\";");
else
sb.append("\"");
}
sb.append("\n");
out.write(sb.toString().getBytes());
continue;
}
if ( line.trim().equals("") && qntCamposCSV > 1 )
break;
readColunaCSV(line); // init linhaCSV
for ( int i=0;i<qntCamposCSV;i++ ){
if ( linhaCSV != null ){
valorColuna=readColunaCSV();
if ( valorColuna == null )
linhaCSV=null; // nao precisar ler mais nada
}
selectCSV_camposValue[i]=valorColuna;
}
processaRegistroSqlParaSelectCSV(out);
}
closeLine();
}
catch(Exception e)
{
if ( ! csvFile.equals("") )
System.err.println("Erro: "+e.toString());
else
System.err.println("Erro: "+e.toString()+" file:"+csvFile);
System.exit(1);
}
out.flush();
out.close();
}
// comando "y banco selectCSV"(nao confundir com "y selectCSV")
public void selectCSV(String conn,String parm){
boolean onlychar=false;
String onlychar_=System.getenv("CSV_ONLYCHAR_Y");
if ( onlychar_ != null && onlychar_.equals("S") )
onlychar=true;
boolean com_separador_final=false;
String com_separador_final_=System.getenv("COM_SEPARADOR_FINAL_CSV_Y");
if ( com_separador_final_ != null && com_separador_final_.equals("S") )
com_separador_final=true;
boolean semHeader=false;
String semHeader_=System.getenv("SEM_HEADER_CSV_Y");
if ( semHeader_ != null && semHeader_.equals("S") )
semHeader=true;
// configuracao TZ UTC NATAL YYYY-MM-DD
String dataT=" ";
String dataZ=" ";
boolean flag_natal=false;
boolean flag_ymd=false;
String format_data=System.getenv("FORMAT_DATA_Y");
if ( format_data != null && format_data.equals("TZ") ){
dataT="T";
dataZ="Z";
}
if ( format_data != null && format_data.equals("UTC") )
dataZ=" UTC";
if ( format_data != null && format_data.equals("NATAL") )
flag_natal=true;
if ( format_data != null && format_data.equals("YYYY-MM-DD") )
flag_ymd=true;
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
long count=0;
String parm_=parm;
try{
con = getcon(conn);
if ( con == null ){
System.err.println("Não foi possível se conectar!!" );
return;
}
if ( parm.equals("") ){
String line;
while( (line=readLine()) != null )
parm+=line+"\n";
closeLine();
}
parm=removePontoEVirgual(parm);
stmt = con.createStatement();
rs=null;
ResultSetMetaData rsmd;
ArrayList<String> campos=new ArrayList<String>();
ArrayList<Integer> tipos=new ArrayList<Integer>();
StringBuilder sb=null;
String tmp="";
String table="";
String header="";
String first_detail="";
boolean first=true;
rs=stmt.executeQuery(parm);
rsmd=rs.getMetaData();
table=getTableByParm(parm);
for ( int i=1;i<=rsmd.getColumnCount();i++ )
{
campos.add(rsmd.getColumnName(i));
tipos.add(rsmd.getColumnType(i));
}
while ( rs.next() ){
sb=new StringBuilder();
for ( int i=0;i<campos.size();i++ ){
tmp=rs.getString(campos.get(i));
if ( tmp == null ){
if ( first )
{
if ( i == campos.size()-1 && !com_separador_final ){
header+="\""+campos.get(i)+"\"";
first_detail+="\"\"";
}else{
header+="\""+campos.get(i)+"\""+sepCSV;
first_detail+="\"\""+sepCSV;
}
}else{
sb.append("\"\"");
sb.append(sepCSV);
}
continue;
}
if ( tipo_cadastrado(tipos.get(i)) ){
if ( tipo_numerico(tipos.get(i)) && tmp.startsWith(".") )
tmp="0"+tmp;
if ( tipos.get(i) == 93 ) // DATA
if ( flag_natal )
tmp="25/12/"+tmp.substring(0, 4)+dataT+tmp.substring(11, 19)+dataZ;
else
if ( flag_ymd )
tmp=tmp.substring(0, 4)+"-"+tmp.substring(5, 7)+"-"+tmp.substring(8, 10)+dataT+tmp.substring(11, 19)+dataZ;
else
tmp=tmp.substring(8, 10)+"/"+tmp.substring(5, 7)+"/"+tmp.substring(0, 4)+dataT+tmp.substring(11, 19)+dataZ;
// o csv suporta ".."".." mas para ficar mais simples o comando abaixo tira o "
tmp=tmp.replace("\"","").replace("\n","");
tmp=tmp.trim();
if ( first )
{
if ( i == campos.size()-1 && !com_separador_final ){
header+="\""+campos.get(i)+"\"";
if ( onlychar && tipo_numerico(tipos.get(i)) ){
first_detail+=tmp;
}else{
first_detail+="\""+tmp+"\"";
}
}else{
header+="\""+campos.get(i)+"\""+sepCSV;
if ( onlychar && tipo_numerico(tipos.get(i)) ){
first_detail+=tmp+sepCSV;
}else{
first_detail+="\""+tmp+"\""+sepCSV;
}
}
}else{
// nao imprime delimitador em onlychar e tipos.get(i) == 2
if ( onlychar && tipo_numerico(tipos.get(i)) ){
}else{
sb.append("\"");
}
sb.append(tmp);
if ( onlychar && tipo_numerico(tipos.get(i)) ){
}else{
sb.append("\"");
}
if ( i == campos.size()-1 && !com_separador_final ){
}else{
sb.append(sepCSV);
}
}
continue;
}
close(rs,stmt,con);
throw new Exception("tipo desconhecido:"+tipos.get(i) + " -> " + rs.getString(campos.get(i)) );
}
if ( first ){
first=false;
if ( !semHeader )
System.out.println(header);
System.out.println(first_detail);
count++;
continue;
}
System.out.println(sb.toString());
count++;
}
}
catch(Exception e){
System.err.println("Erro: "+e.toString()+" -> "+parm_);
close(rs,stmt,con);
System.exit(1);
}
close(rs,stmt,con);
try_finish_and_count(count);
}
public void executeInsert(String conn, InputStream pipe){
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
boolean par=true;
String line="";
StringBuilder sb=null;
boolean ok=true;
int limiteAgulha=50000; // all.length();
String initial_sb=" insert all";
String final_sb=" select * from dual";
String ii;
StringBuilder all=new StringBuilder(initial_sb);
ArrayList<String> cover=new ArrayList<String>();
String command="";
boolean achou=false;
readLineB(pipe);
try{
con = getcon(conn);
if ( con == null ){
System.err.println("Não foi possível se conectar!!" );
return;
}
con.setAutoCommit(false);
stmt = con.createStatement();
while( (line=readLineB()) != null ){
if ( par && line.trim().equals("") )
continue;
if ( par ){
if ( line.trim().startsWith("commit") || line.trim().startsWith("COMMIT") )
{
try{
ii=removePontoEVirgual(line);
stmt.execute(ii);
}catch(Exception e){
System.err.println("Erro: "+e.toString()+" -> "+line);
close(rs,stmt,con);
System.exit(1);
}
continue;
}
if ( startingInsert(line) )
{
if ( par=countParAspeta(par,line) ){
try{
ii=removePontoEVirgual(line);
if ( all.length() >= limiteAgulha ){
all.append(ii.substring(6));
cover.add(ii);
all.append(final_sb);
try{
stmt.execute(all.toString());
}catch(Exception e){
// repescagem
for(String iii : cover){
try{
stmt.execute(iii);
}catch(Exception ee){
achou=false;
for ( String ora : ORAs ){
if ( ee.toString().contains(ora) ){
System.out.println("Warnning: "+iii);
ok=false;
achou=true;
break;
}
}
if ( ! achou ){
command=iii;
throw ee;
}
}
}
}
all=null;
all=new StringBuilder(initial_sb);
cover=null;
cover=new ArrayList<String>();
}else{
all.append(ii.substring(6));
cover.add(ii);
}
}catch(Exception e){
System.err.println("Erro: "+e.toString()+" -> "+line);
close(rs,stmt,con);
System.exit(1);
}
continue;
}else{
sb=null;// forçando limpeza de memoria
sb=new StringBuilder(line);
}
continue;
}
close(rs,stmt,con);
throw new Exception("Erro, linha inesperada:" +line);
}else{
if ( par=countParAspeta(par,line) ){
try{
sb.append("\n");
sb.append(removePontoEVirgual(line));
ii=sb.toString();
if ( all.length() >= limiteAgulha ){
all.append(ii.substring(6));
cover.add(ii);
all.append(final_sb);
try{
stmt.execute(all.toString());
}catch(Exception e){
// repescagem
for(String iii : cover){
try{
stmt.execute(iii);
}catch(Exception ee){
achou=false;
for ( String ora : ORAs ){
if ( ee.toString().contains(ora) ){
System.out.println("Warnning: "+iii);
ok=false;
achou=true;
break;
}
}
if ( ! achou ){
command=iii;
throw ee;
}
}
}
}
all=null;
all=new StringBuilder(initial_sb);
cover=null;
cover=new ArrayList<String>();
}else{
all.append(ii.substring(6));
cover.add(ii);
}
}catch(Exception e){
System.err.println("Erro: "+e.toString()+" -> "+line);
close(rs,stmt,con);
System.exit(1);
}
continue;
}else{
sb.append("\n");
sb.append(line);
}
}
}
if ( ! all.toString().equals(initial_sb) ){
all.append(final_sb);
try{
stmt.execute(all.toString());
}catch(Exception e){
// repescagem
for(String iii : cover){
try{
stmt.execute(iii);
}catch(Exception ee){
achou=false;
for ( String ora : ORAs ){
if ( ee.toString().contains(ora) ){
System.out.println("Warnning: "+iii);
ok=false;
achou=true;
break;
}
}
if ( ! achou ){
command=iii;
close(rs,stmt,con);
throw ee;
}
}
}
}
all=null;
cover=null;
}
close(rs,stmt,con);
}catch(Exception e){
if ( ! command.equals(""))
System.err.println("Erro: "+e.toString().replace("\n","")+" -> "+command);
else
System.err.println("Erro: "+e.toString());
close(rs,stmt,con);
System.exit(1);
}
if ( ok )
System.out.println("OK");
close(rs,stmt,con);
closeLineB();
}
public boolean execute(String conn,String parm){
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
try{
con = getcon(conn);
if ( con == null ){
System.err.println("Não foi possível se conectar!!" );
return false;
}
if ( parm.equals("") ){
String line;
while( (line=readLine()) != null )
parm+=line+"\n";
closeLine();
}
if ( ! parm.trim().toUpperCase().startsWith("DECLARE") )
parm=removePontoEVirgual(parm);
stmt = con.createStatement();
stmt.execute(parm);
System.out.println("OK");
}
catch(Exception e)
{
System.err.println("Erro: "+e.toString()+" -> "+parm);
close(rs,stmt,con);
System.exit(1);
return false;
}
close(rs,stmt,con);
return true;
}
public void buffer(String [] args){
if ( args.length == 2 ){
buffer(n_lines_buffer_DEFAULT,null);
return;
}
if ( args.length == 4 && args[2].equals("-n_lines") ){
buffer(tryConvertNumberPositiveByString(n_lines_buffer_DEFAULT,args[3]),null);
return;
}
if ( args.length == 4 && args[2].equals("-log") ){
buffer(n_lines_buffer_DEFAULT,args[3]);
return;
}
if ( args.length == 6 && args[2].equals("-n_lines") && args[4].equals("-log") ){
buffer(tryConvertNumberPositiveByString(n_lines_buffer_DEFAULT,args[3]),args[5]);
return;
}
}
public void buffer(final int n_lines_buffer,String caminhoLog_){
try{
final List<String> lista=Collections.synchronizedList(new ArrayList<String>());
final boolean [] finishIn=new boolean[]{false};
final long [] countLinhasIn=new long []{0,0,0}; // 0-> contador;1-> contador informado; 2-> contador desligado
final long [] countLinhasOut=new long []{0,0,0}; // 0-> contador;1-> contador informado; 2-> contador desligado
final int sizeMaskSpeedCount=6;
final int sizeMaskBufferCount=(n_lines_buffer+"").length();
final String [] caminhoLog=new String[]{caminhoLog_};
final PrintWriter [] out=new PrintWriter[1];
final SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
// abrindo arquivo
if ( caminhoLog[0] != null )
{
try{
out[0]=new PrintWriter(caminhoLog[0], "UTF-8");
}catch(Exception e){
caminhoLog[0]=null;
}
}
// thread log
if ( caminhoLog[0] != null )
{
new Thread() {
public void run() {
try{
long time1=System.currentTimeMillis();
long time2=time1;
long countIn;
long countOut;
out[0].println(formatter.format(new Date()) + " - start");
out[0].flush();
while(true)
{
time2=System.currentTimeMillis();
if ( countLinhasIn[2] == 1 && countLinhasOut[2] == 1 ){ // fim
break;
}
if ( time2 >= time1+1000 )
{
time1=time2;
countIn=0;
countOut=0;
if ( countLinhasIn[1] == 0 ){
countIn=countLinhasIn[0];
countLinhasIn[1]=countIn;
}
if ( countLinhasOut[1] == 0 ){
countOut=countLinhasOut[0];
countLinhasOut[1]=countOut;
}
out[0].println( formatter.format(new Date()) + " - linhas/s[in]: " + lpad(countIn,sizeMaskSpeedCount," ") + " - linhas/s[out]: " + lpad(countOut,sizeMaskSpeedCount," ") + " - buffer: " + lpad(lista.size(),sizeMaskBufferCount," ") );
out[0].flush();
}
Thread.sleep(100);
}
}catch(Exception e){
caminhoLog[0]=null;
}
}
}.start();
}
// thread in
new Thread() {
public void run() {
String line;
while( true ){
if ( lista.size() < n_lines_buffer )
{
if ( (line=readLine()) != null )
{
lista.add(line);
if ( caminhoLog[0] != null )
contabiliza(countLinhasIn);
}else{
finishIn[0]=true;
break;
}
}
}
closeLine();
countLinhasIn[2]=1;
}
}.start();
// saida
while( true ){
if ( finishIn[0] ){
while(lista.size() > 0){
System.out.println(lista.get(0));
lista.remove(0);
if ( caminhoLog[0] != null )
contabiliza(countLinhasOut);
}
countLinhasOut[2]=1;
break;
}
if (lista.size() > 0){
System.out.println(lista.get(0));
lista.remove(0);
if ( caminhoLog[0] != null )
contabiliza(countLinhasOut);
}
}
// fechando arquivo
if ( caminhoLog[0] != null )
{
try{
out[0].println(formatter.format(new Date()) + " - end");
out[0].flush();
out[0].close();
}catch(Exception e){
System.out.println(e.toString());
}
}
}catch(Exception e){
System.out.println(e.toString());
}
}
public void contabiliza(long [] countLinhas){
if ( countLinhas[1] > 0 )
{
countLinhas[0]-=countLinhas[1];
if ( countLinhas[0] < 0 )
countLinhas[0]=0;
countLinhas[1]=0;
}
countLinhas[0]++;
}
public String lpad(long inputLong, int length,String append) {
if ( inputLong < 0 )
return lpad(true,(inputLong+"").substring(1),length,append);
else
return lpad(false,inputLong+"",length,append);
}
public String lpad(String inputString, int length,String append) {
return lpad(false,inputString,length,append);
}
public String lpad(boolean sinalNegativo, String inputString, int length,String append) {
int len_input=inputString.length();
if ( len_input >= length) {
if ( sinalNegativo )
return "-"+inputString;
else
return inputString;
}
StringBuilder sb = new StringBuilder(sinalNegativo?"-":"");
for ( int i=0;i<=length-len_input;i++ )
sb.append(append);
sb.append(inputString);
return sb.toString();
}
public String gettoken(String hash){
String dir_token=getenv();
if ( ! env_ok(dir_token) )
return null;
return lendo_token(dir_token,hash);
}
public String apresentacao(String [] programas)
{
String retorno="";
for ( int i=0;i<programas.length;i++ )
retorno+="\n [" + programas[i] + "]";
return "usage:"+retorno;
}
public boolean env_ok(String dir_token)
{
if ( dir_token == null ){
System.err.println("Para usar o token é necessário ter a variável de ambiente TOKEN_Y definida, ex export TOKEN_Y=/home/user/.token_y");
return false;
}
File f = new File(dir_token);
if ( ! f.exists() ){
if ( ! f.mkdir() ){
System.err.println("Não foi possível utilizar/criar a pasta "+dir_token);
return false;
}
}
if ( ! f.isDirectory() ){
System.err.println("O caminho "+dir_token+" não é um diretório");
return false;
}
return true;
}
public String gravado_token(String dir_token,String value){
dir_token=fix_caminho(dir_token);
String md5=digest_text(value,"MD5");
if(salvando_file(value+"\n",new File(dir_token+md5)))
return md5;
return null;
}
public String lendo_token(String dir_token,String md5){
dir_token=fix_caminho(dir_token);
if ( ! new File(dir_token+md5).exists() )
return null;
return lendo_arquivo(dir_token+md5);
}
public boolean salvando_file(String texto, File arquivo) {
try{
BufferedWriter out = new BufferedWriter(new FileWriter(arquivo));
out.write(texto);
out.flush();
out.close();
return true;
}catch(Exception e){
System.err.println(e.toString());
}
return false;
}
public String lendo_arquivo(String caminho) {
String result="";
String strLine;
try{
readLine(caminho);
while ((strLine = readLine()) != null) {
if ( result.equals("") )
result+=strLine;
else
result+="\n"+strLine;
}
closeLine();
}catch (Exception e){
System.out.println(e.toString());
}
return result;
}
public void try_load_libraries(){
try{
Class.forName("oracle.jdbc.OracleDriver");
}catch (Exception e){
System.err.println("Não foi possível carregar a biblioteca Oracle");
System.exit(1);
}
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}catch (Exception e){
System.err.println("Não foi possível carregar a biblioteca SQL Server");
System.exit(1);
}
}
public void try_load_ORAs() {
ORAs=lendo_arquivo_pacote("/y/ORAs").split("\n");
try{
String caminho=System.getenv("ORAs_Y");
if ( ! new File(caminho).exists() ) return;
ArrayList<String> lista=new ArrayList<String>();
String line;
readLine(caminho);
while ((line = readLine()) != null)
lista.add(line);
closeLine();
if ( lista.size() > 0 )
{
ORAs=new String[lista.size()];
for ( int i=0;i<lista.size();i++ )
ORAs[i]=lista.get(i);
}
}catch (Exception e){
//try_load_ORAs
}
}
public String fix_caminho(String caminho){
if ( ! caminho.endsWith("/") && caminho.contains("/") )
return caminho+"/";
if ( ! caminho.endsWith("\\") && caminho.contains("\\") )
return caminho+"\\";
return caminho;
}
public String getenv(){
if ( local_env != null && new File(local_env).exists() )
return local_env;
return System.getenv("TOKEN_Y");
}
public String getTableByParm(String parm){
String retorno="";
try{
retorno=parm.toUpperCase().replace(")"," ").replace("\n"," ").replace(","," ").replace("*"," ").split("FROM ")[1].split(" ")[0].trim();
if ( retorno.length() == 0 )
return "";
}catch(Exception e){
return "";
}
return retorno;
}
public String removePontoEVirgual(String txt){
String retorno=RTRIM(txt);
if ( retorno.endsWith(";") )
return retorno.substring(0,retorno.length()-1);
return retorno;
}
public boolean startingInsert(String txt){
txt=LTRIM(txt);
return txt.startsWith("insert") || txt.startsWith("INSERT");
}
public boolean countParAspeta(boolean par,String txt){
int p=0;
int len=txt.length();
while(true){
p=txt.indexOf("'",p);
if ( p == -1 )
return par;
else{
par=!par;
p++;
if ( p >= len )
return par;
}
}
}
public String LTRIM(String txt){
return txt.replaceAll("^\\s+","");
}
public String RTRIM(String txt){
return txt.replaceAll("\\s+$","");
}
public char[] encodeHex(byte[] data) {
char[] toDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
int l = data.length;
char[] out = new char[l << 1];
for (int i = 0, j = 0; i < l; i++) {
out[j++] = toDigits[(0xF0 & data[i]) >>> 4];
out[j++] = toDigits[0x0F & data[i]];
}
return out;
}
public Connection getcon(String stringcon){
if ( stringcon.startsWith("jdbc:sqlserver") ){
//SQLServer
try {
//Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
return DriverManager.getConnection(stringcon);
} catch (Exception x) {
System.err.println("Erro na conexão:"+x.toString());
}
}else{
//Oracle
if ( stringcon.split("\\|").length != 3){
System.err.println("Erro na conexão: Login e senha não encontrado!");
return null;
}else{
String par = stringcon.split("\\|")[0];
String user = stringcon.split("\\|")[1];
String pass = stringcon.split("\\|")[2];
try {
//Class.forName("oracle.jdbc.OracleDriver");
return DriverManager.getConnection(par, user, pass);
} catch (Exception x) {
System.err.println("Erro na conexão:"+x.toString());
}
}
}
return null;
}
public static void readLine(String caminho) throws Exception{
readLine(new FileInputStream(new File(caminho)));
}
public static java.util.Scanner scanner_pipe=null;
public static void readLine(InputStream in){
readLine(in,null,null);
}
public static void readLine(InputStream in,String encoding,String delimiter){
if ( delimiter == null )
delimiter="\n";
if ( encoding == null )
scanner_pipe=new java.util.Scanner(in);
else
scanner_pipe=new java.util.Scanner(in,encoding);
scanner_pipe.useDelimiter(delimiter);
}
public static String readLine(){
try{
if ( scanner_pipe == null ){
readLine(System.in);
}
if ( scanner_pipe.hasNext() )
return scanner_pipe.next().replace("\r","");
else
return null;
}catch(java.util.NoSuchElementException no) {
return null;
}catch(Exception e){
System.err.println("NOK: "+e.toString());
}
return null;
}
public static void closeLine(){
try{
scanner_pipe.close();
}catch(Exception e){}
scanner_pipe=null;
}
public static java.util.Scanner scanner_pipeB=null;
public void readLineB(String caminho) throws Exception{
readLineB(new FileInputStream(new File(caminho)));
}
public void readLineB(InputStream in){
scanner_pipeB=new java.util.Scanner(in);
scanner_pipeB.useDelimiter("\n");
}
public String readLineB(){
try{
if ( scanner_pipeB == null )
readLineB(System.in);
if ( scanner_pipeB.hasNext() )
return scanner_pipeB.next();
else
return null;
}catch(java.util.NoSuchElementException no) {
return null;
}catch(Exception e){
System.err.println("NOK: "+e.toString());
}
return null;
}
public void closeLineB(){
try{
scanner_pipeB.close();
}catch(Exception e){}
scanner_pipeB=null;
}
public static InputStream inputStream_pipe=null;
public void readBytes(String caminho) throws Exception{
readBytes(new File(caminho));
}
public void readBytes(File file) throws Exception{
readBytesInit();
inputStream_pipe=new FileInputStream(file);
}
public int readBytes(byte[] buf){
return readBytes(buf,0,BUFFER_SIZE);
}
int read1Byte_n=-1;
int read1Byte_len=-1;
public void readBytesInit(){
read1Byte_n=-1;
read1Byte_len=-1;
}
public int readBytes(byte[] buf,int off,int len){
try{
if ( inputStream_pipe == null ){
readBytesInit();
inputStream_pipe=System.in;
}
int retorno=-1;
while( (retorno=inputStream_pipe.read(buf,off,len)) == 0 ){}
return retorno;
}catch(Exception e){
System.err.println("Erro, "+e.toString());
System.exit(1);
}
return -1;
}
byte[] read1ByteBuff = new byte[BUFFER_SIZE];
public boolean read1Byte(byte [] b){
if ( inputStream_pipe == null ){
readBytesInit();
inputStream_pipe=System.in;
}
if ( read1Byte_n == -1 || read1Byte_n >= read1Byte_len ){
read1Byte_n=0;
read1Byte_len=readBytes(read1ByteBuff);
}
if ( read1Byte_n < read1Byte_len ){
b[0]=read1ByteBuff[read1Byte_n];
read1Byte_n++;
return true;
}
return false;
}
public void closeBytes(){
try{
inputStream_pipe.close();
}catch(Exception e){}
inputStream_pipe=null;
}
public void write1Byte(int b){
write1Byte(new byte[]{(byte)b});
}
// write1Byte
byte[] write1ByteBuff = new byte[BUFFER_SIZE];
int write1Byte_n=0;
public void write1Byte(byte [] b){
if ( write1Byte_n >= BUFFER_SIZE ){
System.out.write(write1ByteBuff, 0, BUFFER_SIZE);
write1Byte_n=0;
}
write1ByteBuff[write1Byte_n]=b[0];
write1Byte_n++;
}
public void write1ByteFlush(){
System.out.write(write1ByteBuff, 0, write1Byte_n);
}
/*
y zip add File1.txt > saida.zip
cat File1.txt | y zip add -name File1.txt > saida.zip
y zip add /pasta1 > saida.zip
y zip list arquivo.zip
cat arquivo.zip | y zip list
y zip extract entrada.zip
cat entrada.zip | y zip extract
y zip extract entrada.zip -out /destino
cat entrada.zip | y zip extract -out /destino
y zip extractSelected entrada.zip pasta1/unicoArquivoParaExtrair.txt -out /destino
cat entrada.zip | y zip extractSelected pasta1/unicoArquivoParaExtrair.txt -out /destino
y zip extractSelected entrada.zip pasta1/unicoArquivoParaExtrair.txt > /destino/unicoArquivoParaExtrair.txt
cat entrada.zip | y zip extractSelected pasta1/unicoArquivoParaExtrair.txt > /destino/unicoArquivoParaExtrair.txt
*/
private void zip_add(String a,String dummy_name) throws Exception {
if ( a != null ){
valida_leitura_arquivo(a);
if ( a.equals(".") || a.equals("..") ){
System.err.println("Erro, esse tipo de diretório não é válido!: "+a);
System.exit(1);
}
}
zip_add(a,dummy_name,System.out);
}
private void valida_leitura_arquivo(String a){
if ( ! new File(a).exists() ){
System.err.println("Erro, esse conteudo nao existe: "+a);
System.exit(1);
}
}
private java.util.zip.ZipOutputStream zip_output=null;
private ArrayList<String> zip_elementos=null;
private void zip_add(String a, String dummy_name, OutputStream os) throws Exception {
zip_output = new java.util.zip.ZipOutputStream(os);
File elem=null;
String dummy="dummy";
if ( dummy_name != null && dummy_name.length() > 0 )
dummy=dummy_name;
if ( a!=null )
elem=new File(a);
if ( elem==null || elem.isFile() ){
java.util.zip.ZipEntry e=null;
if ( elem == null )
e=new java.util.zip.ZipEntry(dummy);
else
e=new java.util.zip.ZipEntry(elem.getName());
zip_output.putNextEntry(e);
if ( elem!=null )
readBytes(elem);
byte[] buf = new byte[BUFFER_SIZE];
int len;
while ((len = readBytes(buf)) > -1)
zip_output.write(buf, 0, len);
closeBytes();
}else{
String path=elem.getAbsolutePath().replace("\\","/");
if ( ! path.endsWith("/") )
path+="/";
zip_elementos=new ArrayList<String>();
if ( !a.contains("/") && !a.contains("\\") ){
path+="../";
zip_elementos.add(a+"/");
zip_navega(elem,a+"/");
}else{
zip_navega(elem,"");
}
int lenB=zip_elementos.size();
for ( int i=0;i<lenB;i++ ){
java.util.zip.ZipEntry e=new java.util.zip.ZipEntry( zip_elementos.get(i) );
zip_output.putNextEntry(e);
if ( ! zip_elementos.get(i).endsWith("/") ){
readBytes(path+zip_elementos.get(i));
byte[] buf = new byte[BUFFER_SIZE];
int len;
while ((len = readBytes(buf)) > -1)
zip_output.write(buf, 0, len);
closeBytes();
}
}
}
zip_output.closeEntry();
zip_output.flush();
zip_output.close();
}
private void zip_navega(File a, String caminho) {
java.io.File[] filhos=a.listFiles();
for ( int i=0;i<filhos.length;i++ ){
if ( filhos[i].isFile() )
zip_elementos.add(caminho+filhos[i].getName());
if ( filhos[i].isDirectory() ){
zip_elementos.add(caminho+filhos[i].getName()+"/");
zip_navega(filhos[i],caminho+filhos[i].getName()+"/");
}
}
}
private void zip_list(String a) throws Exception {
valida_leitura_arquivo(a);
if ( a == null ){
ZipInputStream zis=new ZipInputStream(System.in);
ZipEntry entry=null;
while( (entry=zis.getNextEntry()) != null ){
System.out.println(entry.getName());
}
}else{
ZipFile zipFile = new ZipFile(a);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while(entries.hasMoreElements()){
ZipEntry entry = entries.nextElement();
System.out.println(entry.getName());
}
}
}
private int zip_extract_count_encontrados=0;
private void zip_extract(String a, String pre_dir, String filtro) throws Exception {
zip_extract_count_encontrados=0;
if ( filtro != null && filtro.endsWith("/") ){
System.err.println("Erro, o item selecionado não pode ser uma pasta!: "+filtro);
System.exit(1);
}
if ( pre_dir != null ){
pre_dir=pre_dir.trim();
if ( pre_dir.length() == 0 ){
System.err.println("Erro, preenchimento incorreto de pasta!");
System.exit(1);
}
File pasta_=new File(pre_dir);
if ( ! pasta_.exists() ){
System.err.println("Erro, a pasta "+pre_dir+ " não existe!");
System.exit(1);
}else{
if ( ! pasta_.isDirectory() ){
System.err.println("Erro, o caminho a seguir não é uma pasta: "+pre_dir);
System.exit(1);
}
}
pre_dir=pre_dir.replace("\\","/");
if ( !pre_dir.endsWith("/") )
pre_dir+="/";
}else
pre_dir="";
if ( a != null )
valida_leitura_arquivo(a);
if ( a == null ){
ZipInputStream zis=new ZipInputStream(System.in);
ZipEntry entry=null;
while( (entry=zis.getNextEntry()) != null ){
if ( entry.getName().endsWith("/") ){
zip_extract_grava(pre_dir,entry.getName(),null,filtro);
}else{
zip_extract_grava(pre_dir,entry.getName(),zis,filtro);
}
}
}else{
ZipFile zipFile = new ZipFile(a);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while(entries.hasMoreElements()){
ZipEntry entry = entries.nextElement();
if ( entry.getName().endsWith("/") ){
zip_extract_grava(pre_dir,entry.getName(),null,filtro);
}else{
zip_extract_grava(pre_dir,entry.getName(),zipFile.getInputStream(entry),filtro);
}
}
}
if ( filtro != null && zip_extract_count_encontrados == 0 ){
System.err.println("Erro, elemento "+filtro+" não encontrado!");
System.exit(1);
}
}
private void zip_extract_grava(String pre_dir, String name, InputStream is,String filtro) throws Exception {
String [] partes=name.split("/");
String dir="";
File tmp=null;
boolean out_console=false;
if ( filtro != null && pre_dir.equals("") )
out_console=true;
for ( int i=0;i<partes.length;i++ ){
if ( i == partes.length-1 ){
if ( is == null ){
dir+=partes[i]+"/";
if ( filtro != null && filtro.indexOf(dir) == -1 )
continue;
if ( ! out_console ){
tmp=new File(pre_dir+dir);
if ( tmp.exists() ){
if ( !tmp.isDirectory() ){
System.err.println("Erro, não é possível utilizar o caminho a seguir como pasta: "+pre_dir+dir);
System.exit(1);
}
}else
tmp.mkdir();
}
}else{
dir+=partes[i];
if ( filtro != null && filtro.indexOf(dir) == -1 )
continue;
if ( ! out_console ){
tmp=new File(pre_dir+dir);
if ( tmp.exists() ){
if ( tmp.isDirectory() ){
System.err.println("Erro, não é possível utilizar o caminho a seguir como arquivo: "+pre_dir+dir);
System.exit(1);
}
}
}
if ( filtro == null ){
copiaByStream(is,new FileOutputStream(new File(pre_dir+dir)));
}else{
if ( filtro.equals(dir) ){
zip_extract_count_encontrados++;
if ( out_console ){
copiaByStream(is,System.out);
}else{
copiaByStream(is,new FileOutputStream(new File(pre_dir+dir)));
}
}
}
}
}else{
dir+=partes[i]+"/";
if ( filtro != null && filtro.indexOf(dir) == -1 )
continue;
if ( ! out_console ){
tmp=new File(pre_dir+dir);
if ( tmp.exists() ){
if ( !tmp.isDirectory() ){
System.err.println("Erro, não é possível utilizar o caminho a seguir como pasta: "+pre_dir+dir);
System.exit(1);
}
}else
tmp.mkdir();
}
}
}
}
public void gzip()
{
try{
byte[] buf = new byte[BUFFER_SIZE];
java.util.zip.GZIPOutputStream out = new java.util.zip.GZIPOutputStream(System.out);
int len;
while ((len = readBytes(buf)) > -1)
out.write(buf, 0, len);
out.finish();
closeBytes();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void gunzip()
{
try{
byte[] buf = new byte[BUFFER_SIZE];
java.util.zip.GZIPInputStream out = new java.util.zip.GZIPInputStream(System.in);
int len;
while ((len = out.read(buf)) > -1)
System.out.write(buf, 0, len);
}catch(Exception e){
System.out.println(e.toString());
}
}
public void echo(String [] args)
{
printf(args);
System.out.println("");
}
public void printf(String [] args)
{
if ( args.length > 1 )
System.out.print(args[1]);
for ( int i=2;i<args.length;i++ )
System.out.print(" "+args[i]);
}
public void cat(String [] caminhos)
{
try{
for ( int i=1;i<caminhos.length;i++ )
{
if ( ! new File(caminhos[i]).exists() ){
System.err.println("Erro, este arquivo não existe: "+caminhos[i]);
return;
}
}
for ( int i=1;i<caminhos.length;i++ )
{
byte[] buf = new byte[BUFFER_SIZE];
FileInputStream fis = new FileInputStream(caminhos[i]);
int len;
while ((len = fis.read(buf)) > -1)
System.out.write(buf, 0, len);
fis.close();
}
}catch(Exception e){
System.err.println("Erro, "+e.toString());
}
}
public void digest(String tipo){
try {
MessageDigest digest=MessageDigest.getInstance(tipo);
byte[] buf = new byte[BUFFER_SIZE];
int len;
while( (len=readBytes(buf)) > -1 )
digest.update(buf, 0, len);
closeBytes();
System.out.println(new String(encodeHex(digest.digest())));
} catch (Exception ex) {
System.err.println("Erro: "+ex.toString());
}
}
public String digest_text(String txt,String tipo){
try {
byte[] bytesOfMessage = txt.getBytes("UTF-8");
MessageDigest md = MessageDigest.getInstance(tipo);
return new String(encodeHex(md.digest(bytesOfMessage)));
} catch (Exception e) {
System.out.println(e.toString());
}
return null;
}
public int tryConvertNumberPositiveByString(int n_lines_buffer,String value){
try{
int tmp=Integer.parseInt(value);
if ( tmp >= 0 )
return tmp;
}catch(Exception e){
System.out.println(e.toString());
}
return n_lines_buffer;
}
public void grep(String [] args)
{
boolean print=false;
String line_bkp="";
String line="";
ArrayList<Boolean> lista_starting=new ArrayList<Boolean>();
ArrayList<Boolean> lista_ending=new ArrayList<Boolean>();
ArrayList<String> lista_txt=new ArrayList<String>();
ArrayList<String> lista=get_v_i_txt(args);
if ( lista == null ){
comando_invalido(args);
return;
}
boolean v_=lista.get(0).equals("S");
boolean i_=lista.get(1).equals("S");
for ( int i=2;i<lista.size();i+=3 ){
lista_starting.add(lista.get(i).equals("S"));
lista_ending.add(lista.get(i+1).equals("S"));
lista_txt.add(lista.get(i+2));
}
if ( i_ )
lista_txt.set(0,lista_txt.get(0).toUpperCase());
try {
while ( (line=line_bkp=readLine()) != null ) {
print=false;
if ( i_ )
line=line.toUpperCase();
for ( int i=0;i<lista_txt.size();i++ ){
if ( lista_txt.get(i).equals("") && lista_starting.get(i) && lista_ending.get(i) ){ // ^$
if (line.equals("")){
print=true;
break;
}else
continue;
}
if ( !lista_starting.get(i) && !lista_ending.get(i) && line.contains(lista_txt.get(i)) ){
print=true;
break;
}
if ( lista_starting.get(i) && !lista_ending.get(i) && line.startsWith(lista_txt.get(i)) ){
print=true;
break;
}
if ( !lista_starting.get(i) && lista_ending.get(i) && line.endsWith(lista_txt.get(i)) ){
print=true;
break;
}
if ( lista_starting.get(i) && lista_ending.get(i) && line.startsWith(lista_txt.get(i)) && line.endsWith(lista_txt.get(i)) ){
print=true;
break;
}
}
if ( v_ )
print=!print;
if ( print )
System.out.println(line);
}
closeLine();
}catch(Exception e){
System.out.println(e.toString()+" - "+line_bkp);
}
}
public void wc_l()
{
try {
long count=0;
while ( (readLine()) != null )
count++;
closeLine();
System.out.println(count);
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
}
public void head(String [] args)
{
long p;
String line;
long count=0;
try{
if ( args.length == 1 )
p=10;
else
p=Long.parseLong(args[1].substring(1));
}catch(Exception e){
comando_invalido(args);
return;
}
try {
while ( (line=readLine()) != null ) {
if ( ++count <= p )
System.out.println(line);
else{
closeLine();
break;
}
}
closeLine();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void tail(String [] args)
{
int p;
String line;
ArrayList<String> lista=new ArrayList<String>();
try{
if ( args.length == 1 )
p=10;
else
p=Integer.parseInt(args[1].substring(1));
}catch(Exception e){
comando_invalido(args);
return;
}
try {
while ( (line=readLine()) != null ) {
lista.add(line);
if ( lista.size() > p )
lista.remove(0);
}
closeLine();
for ( int i=0;i<lista.size();i++ ){
System.out.println(lista.get(i));
}
lista=null;
}catch(Exception e){
System.out.println(e.toString());
}
}
public void cut(String [] args){
String [] partes=args[1].substring(2).split(",");
int [] elem=new int[partes.length*2];
int count=0;
try{
for ( int i=0;i<partes.length;i++ )
{
if (
partes[i].startsWith("-")
&& ! partes[i].endsWith("-")
&& ! partes[i].substring(1).contains("-")
&& Integer.parseInt(partes[i].substring(1)) >= 1
)
{
elem[count++]=-1;
elem[count++]=Integer.parseInt(partes[i].substring(1));
continue;
}
if (
! partes[i].startsWith("-")
&& partes[i].endsWith("-")
&& ! partes[i].substring(0,partes[i].length()-2).contains("-")
&& Integer.parseInt(partes[i].substring(0,partes[i].length()-1)) >= 1
)
{
elem[count++]=Integer.parseInt(partes[i].substring(0,partes[i].length()-1));
elem[count++]=-1;
continue;
}
if (
! partes[i].startsWith("-")
&& ! partes[i].endsWith("-")
&& partes[i].split("-").length == 2
&& Integer.parseInt(partes[i].split("-")[0]) >= 1
&& Integer.parseInt(partes[i].split("-")[1]) >= 1
&& Integer.parseInt(partes[i].split("-")[0]) <= Integer.parseInt(partes[i].split("-")[1])
)
{
elem[count++]=Integer.parseInt(partes[i].split("-")[0]);
elem[count++]=Integer.parseInt(partes[i].split("-")[0]);
continue;
}
if (
! partes[i].contains("-")
&& Integer.parseInt(partes[i]) >= 1
)
{
elem[count++]=Integer.parseInt(partes[i]);
elem[count++]=Integer.parseInt(partes[i]);
continue;
}
comando_invalido(args);
return;
}
}catch(Exception e){
comando_invalido(args);
return;
}
try {
String line=null;
while ( (line=readLine()) != null ) {
for ( int i=0;i<elem.length;i+=2 ){
if ( elem[i] == -1 ){
if ( line.length() < elem[i+1] )
System.out.print(line);
else
System.out.print(line.substring(0,elem[i+1]));
continue;
}
if ( elem[i+1] == -1 ){
if ( line.length() < elem[i] )
System.out.print("");
else
System.out.print(line.substring(elem[i]-1));
continue;
}
if ( line.length() < elem[i] )
System.out.print("");
else
if ( line.length() < elem[i+1] )
System.out.print(line.substring(elem[i]-1));
else
System.out.print(line.substring(elem[i]-1,elem[i+1]));
continue;
}
System.out.println("");
}
closeLine();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void sedBasic(String [] args)
{
String line;
while ( (line=readLine()) != null ) {
for ( int i=1;i<args.length;i+=2 ){
if ( args[i].length() == 0 ){
System.err.println("Erro nos parametros!!");
System.exit(1);
}
line=line.replace(args[i],args[i+1]);
}
System.out.println(line);
}
}
ArrayList<Byte> sed_agulha1=new ArrayList<Byte>();
int sed_agulha1_count=0;
ArrayList<Byte> sed_agulha2=new ArrayList<Byte>(); // substituir in
int sed_agulha2_count=0;
ArrayList<Byte> sed_agulha3=new ArrayList<Byte>(); // substituir out
int sed_agulha3_count=0;
public void sed(String [] args)
{
byte [] in_=args[1].getBytes();
for ( int i=0;i<in_.length;i++ )
sed_agulha2.add(in_[i]);
sed_agulha2=codificacaoBarra(sed_agulha2);
sed_agulha2_count=sed_agulha2.size();
byte [] out_=args[2].getBytes();
for ( int i=0;i<out_.length;i++ )
sed_agulha3.add(out_[i]);
sed_agulha3=codificacaoBarra(sed_agulha3);
sed_agulha3_count=sed_agulha3.size();
byte[] entrada_ = new byte[1];
while ( read1Byte(entrada_) ){
// insere lido depois trata!!
sed_agulha1.add(entrada_[0]);
sed_agulha1_count++;
if ( sed_agulha1_count < sed_agulha2_count )
continue;
if ( sed_agulha1_count > sed_agulha2_count ){
write1Byte(sed_agulha1.get(0));
sed_agulha1.remove(0);
sed_agulha1_count--;
}
if ( sed_agulhas_iguais() ){
for ( int i=0;i<sed_agulha3_count;i++ )
write1Byte(sed_agulha3.get(i));
sed_agulha1=new ArrayList<Byte>();
sed_agulha1_count=0;
}
}
while( sed_agulha1_count>0 ){
write1Byte(sed_agulha1.get(0));
sed_agulha1.remove(0);
sed_agulha1_count--;
}
write1ByteFlush();
}
public ArrayList<Byte> codificacaoBarra(ArrayList<Byte> a)
{
// transforma 97(A) 92(\) 110(n) 97(A)
// em 97(A) 10(\n) 97(A)
// BARRA_R=13; // \r
// CHAR_R=114; // r
// BARRA_N=10; // \n
// CHAR_N=110; // n
//
// BARRA_0=0; // \0
// CHAR_0=48; // 0
// BARRA_A=7; // \a
// CHAR_A=97; // a
// BARRA_B=8; // \b
// CHAR_B=98; // b
// BARRA_T=9; // \t
// CHAR_T=116; // t
// BARRA_V=11; // \v
// CHAR_V=118; // v
// BARRA_F=12; // \f
// CHAR_F=102; // f
// CHAR_BARRA=92; // \\ => \
ArrayList<Byte> lista=new ArrayList<Byte>();
int tail=-1;
int entrada=-1;
for ( int i=0;i<a.size();i++ ){
entrada=byte_to_int_java(a.get(i),false);
if ( tail == -1 ){
tail=entrada;
continue;
}
if ( tail == CHAR_BARRA && entrada == CHAR_R ){ lista.add( Byte.valueOf( (byte)BARRA_R ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_N ){ lista.add( Byte.valueOf( (byte)BARRA_N ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_0 ){ lista.add( Byte.valueOf( (byte)BARRA_0 ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_A ){ lista.add( Byte.valueOf( (byte)BARRA_A ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_B ){ lista.add( Byte.valueOf( (byte)BARRA_B ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_T ){ lista.add( Byte.valueOf( (byte)BARRA_T ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_V ){ lista.add( Byte.valueOf( (byte)BARRA_V ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_F ){ lista.add( Byte.valueOf( (byte)BARRA_F ) ); tail=-1; continue; }
if ( tail == CHAR_BARRA && entrada == CHAR_BARRA ){ lista.add( Byte.valueOf( (byte)CHAR_BARRA ) ); tail=-1; continue; }
lista.add( Byte.valueOf( (byte)tail ) );
tail=entrada;
}
if ( tail != -1 ){
// condição comentada por nao ser possivel atingir
// nao remover o comentario!!
//if ( tail == CHAR_BARRA ){
// System.err.println("Erro, parametro inválido: "+a.toString());
// System.exit(1);
//}
lista.add( Byte.valueOf( (byte)tail ) );
}
return lista;
}
public boolean sed_agulhas_iguais(){
if ( sed_agulha1_count != sed_agulha2_count ){
System.err.println("Erro inesperado!");
System.exit(1);
}
for(int i=0;i<sed_agulha1_count;i++)
if ( (int)sed_agulha1.get(i) != (int)sed_agulha2.get(i) )
return false;
return true;
}
public void n() // \n
{
// modifica arquivo \r\n para \n(se ja tiver \n nao tem problema)
try {
boolean tail_use=false;
byte tail=0;
byte[] entrada_ = new byte[1];
byte entrada=0;
while ( read1Byte(entrada_) ){
entrada=entrada_[0];
if ( ! tail_use ){
tail_use=true;
tail=entrada;
continue;
}
if ( entrada == BARRA_N && tail == BARRA_R ){
tail=entrada;
continue;
}
write1Byte(tail);
tail=entrada;
}
if ( tail_use )
write1Byte(tail);
write1ByteFlush();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void rn() // \n\r
{
// modifica arquivo \n para \r\n(se ja tiver \r\n nao tem problema)
try {
boolean tail_use=false;
byte tail=0;
byte[] entrada_ = new byte[1];
byte entrada=0;
while ( read1Byte(entrada_) ){
entrada=entrada_[0];
if ( ! tail_use ){
tail_use=true;
tail=entrada;
continue;
}
if ( entrada == BARRA_N && tail == BARRA_R ){
write1Byte(tail);
tail=entrada;
continue;
}
if ( entrada == BARRA_N && tail != BARRA_R ){
write1Byte(tail);
write1Byte(BARRA_R);
tail=entrada;
continue;
}
write1Byte(tail);
tail=entrada;
}
if ( tail_use )
write1Byte(tail);
write1ByteFlush();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void bytesToInts(boolean dif_128)
{
try {
byte[] entrada_ = new byte[1];
while ( read1Byte(entrada_) ){
System.out.println( byte_to_int_java(entrada_[0],dif_128) );
}
}catch(Exception e){
System.out.println(e.toString());
}
}
public void intsToBytes(String [] args)
{
String line=null;
int valor=0;
if ( args.length == 1 ){ // stdin
while ( (line=readLine()) != null ) {
try{
valor=Integer.parseInt(line);
}catch(Exception ex){
System.out.println("\nErro, valor invalido: "+line);
System.exit(1);
}
write1Byte(valor);
}
closeLine();
}else{ // parametros
for ( int i=1;i<args.length;i++ ){
try{
valor=Integer.parseInt(args[i]);
}catch(Exception ex){
System.out.println("\nErro, valor invalido: "+line);
System.exit(valor);
}
write1Byte(valor);
}
}
write1ByteFlush();
}
boolean od_b=false;
boolean od_c=false;
boolean od_r=false;
String parm_od="";
public void init_od(String parm)
{
parm_od=parm;
od_b=parm.contains("b");
od_c=parm.contains("c");
od_r=parm.contains("r");
if ( ! od_b && ! od_c && ! od_r ){
od_r=true;
parm_od="r";
}
}
StringBuilder sb_b=new StringBuilder();
StringBuilder sb_c=new StringBuilder();
StringBuilder sb_r=new StringBuilder();
int count_all_od=0;
int count_16_od=0;
public void write1od(int i)
{
if ( od_b )
sb_b.append(OD_BC_B[i]);
if ( od_c )
sb_c.append(OD_BC_C[i]);
sb_r.append(OD_BC_R[i]);
count_16_od++;
count_all_od++;
if ( count_16_od >= 16){
writeOd();
sb_b=new StringBuilder();
sb_c=new StringBuilder();
sb_r=new StringBuilder();
count_16_od=0;
}
}
String tail_od="";
boolean isPrintedRepeat=false;
public void writeOd()
{
String compare=sb_r.toString();
// trata repetição
if ( compare.equals(tail_od) ){
if ( ! isPrintedRepeat ){
isPrintedRepeat=true;
System.out.println("*");
}
return;
}else{
tail_od=compare;
isPrintedRepeat=false;
}
for ( int i=0;i<parm_od.length();i++ ){
writeCarroOd(i==0);
if ( parm_od.substring(i,i+1).equals("b") ){
System.out.println(sb_b.toString());
continue;
}
if ( parm_od.substring(i,i+1).equals("c") ){
System.out.println(sb_c.toString());
continue;
}
if ( parm_od.substring(i,i+1).equals("r") ){
System.out.println(sb_r.toString());
continue;
}
System.out.println("Erro, parametro nao tratado: "+parm_od);
System.exit(1);
}
}
public void writeCarroOd(boolean isPrint)
{
if ( isPrint ){
System.out.print( lpad( Integer.toOctalString(count_all_od-count_16_od).trim() ,7,"0") );
}else{
System.out.print(" ");
}
}
public void writeodFlush()
{
if ( count_16_od > 0 )
writeOd();
count_16_od=0;
writeCarroOd(true);
System.out.println();
}
public void od(String parm)
{
init_od(parm);
try {
int i=0;
byte[] entrada_ = new byte[1];
while ( read1Byte(entrada_) ){
i=byte_to_int_java(entrada_[0],false);
write1od(i);
}
writeodFlush();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void touch(String [] args){
long dif_segundos=0;
long current_milisegundos=System.currentTimeMillis();
SimpleDateFormat format=new SimpleDateFormat("yyyyMMddHHmmss");
Date dataCurrent=null;
try {
if ( args.length == 2 ){
touch(new File(args[1]),current_milisegundos,0);
return;
}
if ( args.length == 3 ){
if ( args[2].length() == 14 ){ //data 20210128235959
dataCurrent=format.parse(args[2]);
current_milisegundos=dataCurrent.getTime();
}else{
dif_segundos=Long.parseLong(args[2]); // 3600
}
touch(new File(args[1]),current_milisegundos,dif_segundos);
return;
}
} catch (Exception ex) {
System.out.println(ex.toString());
System.exit(1);
}
return;
}
public void touch(File file, long current_milisegundos, long dif_segundos) throws Exception{
if (!file.exists())
new FileOutputStream(file).close();
file.setLastModified(current_milisegundos + (dif_segundos*1000) );
}
private boolean isSuportIconv(String a) {
for ( int i=0;i<suportIconv.length;i++ )
if ( a.equals(suportIconv[i]))
return true;
return false;
}
private void iconvUTF8ToWindows(String caminho) {
// existem sequencias irreversiveis que nao suprimidar na conversao padrao mas aqui nao, ex: 226 128 147
try {
boolean tail_use=false;
int tail=0;
byte[] entrada_ = new byte[1];
int entrada=0;
if ( caminho != null && ! caminho.equals("") )
readBytes(caminho);
while ( read1Byte(entrada_) ){
entrada=byte_to_int_java(entrada_[0],false);
if ( ! tail_use ){
tail_use=true;
tail=entrada;
continue;
}
if ( (tail == 194 || tail == 195) && (entrada < 128 || entrada >= 192 ) ){
System.out.println(erroSequenciaIlegal);
System.exit(1);
}
if ( tail == 194 ){
write1Byte(entrada);
tail_use=false;
continue;
}
if ( tail == 195 ){
write1Byte(entrada+64);
tail_use=false;
continue;
}
write1Byte(tail);
tail=entrada;
}
if ( tail_use )
write1Byte(tail);
write1ByteFlush();
closeBytes();
}catch(Exception e){
System.out.println(e.toString());
System.exit(1);
}
}
private void iconvWindowsToUTF8(String caminho) {
try {
byte[] entrada_ = new byte[1];
int entrada=0;
if ( caminho != null && ! caminho.equals("") )
readBytes(caminho);
while ( read1Byte(entrada_) ){
entrada=byte_to_int_java(entrada_[0],false);
if ( entrada >= 128 && entrada < 192 ){
write1Byte(194);
write1Byte(entrada);
continue;
}
if ( entrada >= 192 ){
write1Byte(195);
write1Byte(entrada-64);
continue;
}
write1Byte(entrada);
}
write1ByteFlush();
closeBytes();
}catch(Exception e){
System.out.println(e.toString());
System.exit(1);
}
}
/*
esteiras(normalização em "ISO-8859-1"):
11 -> remove BOM UTF-8
12 -> remove BOM UCS-2LE
21 -> normalizando ISO-8859-1 vindo de UTF-8
22 -> normalizando ISO-8859-1 vindo de UCS-2LE
31 -> codificando para UTF-8
32 -> codificando para UCS-2LE
41 -> colocando BOM UTF-8
42 -> colocando BOM UCS-2LE
50 -> finalizando
*/
ArrayList<Integer> esteiras=new ArrayList<Integer>();
private void iconv(String tipoOrigem, String tipoOrigemPuro, String tipoDestino, String tipoDestinoPuro, String caminho) throws Exception {
if ( caminho != null && ! caminho.equals("") )
readBytes(caminho);
// tirando BOM
if ( tipoOrigem.equals("UTF-8BOM"))
esteiras.add(11);
if ( tipoOrigem.equals("UCS-2LEBOM"))
esteiras.add(12);
// decodificando e codificando
if ( ! tipoOrigemPuro.equals(tipoDestinoPuro) ){
if (tipoOrigemPuro.equals("UTF-8"))
esteiras.add(21);
if (tipoOrigemPuro.equals("UCS-2LE"))
esteiras.add(22);
if (tipoDestinoPuro.equals("UTF-8") )
esteiras.add(31);
if (tipoDestinoPuro.equals("UCS-2LE") )
esteiras.add(32);
}
// colocando BOM
if ( tipoDestino.equals("UTF-8BOM"))
esteiras.add(41);
if ( tipoDestino.equals("UCS-2LEBOM"))
esteiras.add(42);
// finish
esteiras.add(50);
byte[] entrada_ = new byte[1];
int entrada=0;
while ( read1Byte(entrada_) ){
entrada=byte_to_int_java(entrada_[0],false);
nextEsteira(entrada,-1);
}
nextEsteira(-1,-1);// comando para liberar os dados nas agulhas
write1ByteFlush();
closeBytes();
}
public void nextEsteira(int entrada,int seqEsteira){
// proxima esteira
seqEsteira++;
int esteira=esteiras.get(seqEsteira);
// 11 -> remove BOM UTF-8
if ( esteira == 11 ){
esteiraRemoveBOM(entrada,seqEsteira,BOM_UTF_8);
return;
}
// 12 -> remove BOM UCS-2LE
if ( esteira == 12 ){
esteiraRemoveBOM(entrada,seqEsteira,BOM_UCS_2LE);
return;
}
// 21 -> decode UTF-8
if ( esteira == 21 ){
esteiraDecode_UTF_8(entrada,seqEsteira);
return;
}
// 22 -> decode UCS-2LE
if ( esteira == 22 ){
esteiraDecode_UCS_2LE(entrada,seqEsteira);
return;
}
// 31 -> encode UTF-8
if ( esteira == 31 ){
esteiraEncode_UTF_8(entrada,seqEsteira);
return;
}
// 32 -> encode UCS-2LE
if ( esteira == 32 ){
esteiraEncode_UCS_2LE(entrada,seqEsteira);
return;
}
// 41 -> add BOM UTF-8
if ( esteira == 41 ){
esteiraAddBOM(entrada,seqEsteira,BOM_UTF_8);
return;
}
// 42 -> add BOM UCS-2LE
if ( esteira == 42 ){
esteiraAddBOM(entrada,seqEsteira,BOM_UCS_2LE);
return;
}
// 50 -> finish
if ( esteira == 50 ){
esteiraFinish(entrada,seqEsteira);
return;
}
}
int esteiraRemoveBOM_count=0;
int esteiraRemoveBOM_max=-1;
public void esteiraRemoveBOM(int entrada,int seqEsteira,int [] seqBOM){
if ( entrada == -1 ){ // liberando o que sobrou na agulha(tail)
if ( esteiraRemoveBOM_count < esteiraRemoveBOM_max ){
System.out.println(erroSequenciaIlegal);
System.exit(1);
}
nextEsteira(entrada, seqEsteira); // liberando o que sobrou na agulha(tail) para os proximos
return;
}
if ( esteiraRemoveBOM_max == -1 )
esteiraRemoveBOM_max=seqBOM.length;
if ( esteiraRemoveBOM_count < esteiraRemoveBOM_max ){
if ( entrada != seqBOM[esteiraRemoveBOM_count]){
System.out.println(erroSequenciaIlegal);
System.exit(1);
}
esteiraRemoveBOM_count++;
return;
}
nextEsteira(entrada, seqEsteira);
}
boolean decode_UTF_8_tail_use=false;
int decode_UTF_8_tail=-1;
public void esteiraDecode_UTF_8(int entrada,int seqEsteira){
if ( entrada == -1 ){ // liberando o que sobrou na agulha(tail)
if ( decode_UTF_8_tail_use ){
nextEsteira(decode_UTF_8_tail, seqEsteira);
decode_UTF_8_tail_use=false;
}
nextEsteira(entrada, seqEsteira); // liberando o que sobrou na agulha(tail) para os proximos
return;
}
if ( ! decode_UTF_8_tail_use ){
decode_UTF_8_tail_use=true;
decode_UTF_8_tail=entrada;
return;
}
if ( (decode_UTF_8_tail == 194 || decode_UTF_8_tail == 195) && (entrada < 128 || entrada >= 192 ) ){
System.out.println(erroSequenciaIlegal);
System.exit(1);
}
if ( decode_UTF_8_tail == 194 ){
nextEsteira(entrada, seqEsteira);
decode_UTF_8_tail_use=false;
return;
}
if ( decode_UTF_8_tail == 195 ){
nextEsteira(entrada+64, seqEsteira);
decode_UTF_8_tail_use=false;
return;
}
nextEsteira(decode_UTF_8_tail, seqEsteira);
decode_UTF_8_tail=entrada;
}
boolean decode_UCS_2LE_entrada_par=true;
public void esteiraDecode_UCS_2LE(int entrada,int seqEsteira){
if ( entrada == -1 ){ // liberando o que sobrou na agulha(tail)
if ( ! decode_UCS_2LE_entrada_par ){
System.out.println(erroSequenciaIlegal);
System.exit(1);
}
nextEsteira(entrada, seqEsteira); // liberando o que sobrou na agulha(tail) para os proximos
return;
}
decode_UCS_2LE_entrada_par=!decode_UCS_2LE_entrada_par;
if ( decode_UCS_2LE_entrada_par ){
if ( entrada == 0 )
return;
System.out.println(erroSequenciaIlegal);
System.exit(1);
}
nextEsteira(entrada, seqEsteira);
}
public void esteiraEncode_UTF_8(int entrada,int seqEsteira){
if ( entrada == -1 ){ // liberando o que sobrou na agulha(tail)
nextEsteira(entrada, seqEsteira); // liberando o que sobrou na agulha(tail) para os proximos
return;
}
if ( entrada >= 128 && entrada < 192 ){
nextEsteira(194, seqEsteira);
nextEsteira(entrada, seqEsteira);
return;
}
if ( entrada >= 192 ){
nextEsteira(195, seqEsteira);
nextEsteira(entrada-64, seqEsteira);
return;
}
nextEsteira(entrada, seqEsteira);
}
public void esteiraEncode_UCS_2LE(int entrada,int seqEsteira){
if ( entrada == -1 ){ // liberando o que sobrou na agulha(tail)
nextEsteira(entrada, seqEsteira); // liberando o que sobrou na agulha(tail) para os proximos
return;
}
nextEsteira(entrada, seqEsteira);
nextEsteira(0, seqEsteira);
}
boolean esteiraAddBOM_isAdded=false;
public void esteiraAddBOM(int entrada,int seqEsteira,int [] seqBOM){
if ( entrada == -1 ){ // liberando o que sobrou na agulha(tail)
nextEsteira(entrada, seqEsteira); // liberando o que sobrou na agulha(tail) para os proximos
return;
}
if ( ! esteiraAddBOM_isAdded ){
for(int i=0;i<seqBOM.length;i++)
nextEsteira(seqBOM[i], seqEsteira);
esteiraAddBOM_isAdded=true;
}
nextEsteira(entrada, seqEsteira);
}
public void esteiraFinish(int entrada,int seqEsteira){
if ( entrada == -1 ){ // liberando o que sobrou na agulha(tail)
return;
}
write1Byte(entrada);
}
public void tee(String caminho)
{
try{
FileOutputStream out=new FileOutputStream(caminho);
int len;
byte[] buf = new byte[BUFFER_SIZE];
while( (len=readBytes(buf)) > -1){
out.write(buf, 0, len);
System.out.write(buf, 0, len);
}
out.flush();
out.close();
System.out.flush();
closeBytes();
}catch(Exception e){
System.err.println("Erro, "+e.toString());
}
}
public void uniq_quebra(boolean quebra){
String tail=null;
String line=null;
try {
long count=0;
while ( (line=readLine()) != null ){
if ( tail == null ){
count++;
tail=line;
continue;
}
if ( !line.equals(tail) ){
if ( quebra ){
System.out.print(count);
System.out.print(" ");
}
System.out.println(tail);
count=0;
}
tail=line;
count++;
}
if ( tail != null ){
if ( quebra ){
System.out.print(count);
System.out.print(" ");
}
System.out.println(tail);
}
closeLine();
}catch(Exception e){
System.err.println(e.toString());
System.exit(1);
}
}
public void seq(int a,int b,int len){
int inc=1;
if ( a > b )
inc=-1;
while(true){
System.out.println( lpad(a,len,"0") );
if ( a == b )
break;
a+=inc;
}
}
public void awk_print(String [] args)
{
ArrayList<Integer> lista=new ArrayList<Integer>();
int [] elem;
String [] partes;
try{
for ( int i=2;i<args.length;i++ ){
partes=args[i].split(",");
for ( int j=0;j<partes.length;j++ ){
if ( j > 0 )
lista.add(500); // " "
lista.add(Integer.parseInt(partes[j]));
}
}
}catch(Exception e){
comando_invalido(args);
return;
}
// list command print
elem=new int[lista.size()];
for ( int i=0;i<lista.size();i++ )
elem[i]=lista.get(i);
try {
String line=null;
while ( (line=readLine()) != null ) {
// partes de linha
partes=line.replaceAll("\t"," ").replaceAll("\r"," ").split(" ");
for ( int i=0;i<elem.length;i++ ){
if ( elem[i] == 0 )
{
for ( int j=0;j<partes.length;j++ ){
if ( j != 0 )
System.out.print(" ");
System.out.print(partes[j]);
}
continue;
}
if ( elem[i] == 500 )
{
System.out.print(" ");
continue;
}
int p=elem[i];
if ( p > 0 ) // posição iniciada de 0
p-=1;
else
p+=partes.length; // correção do pedido negativo print -1 equivale a print 3 caso o total de palavras seja 4, ou seja, -1 significa o ultimo
if ( p < 0 ) continue;
if ( p >= partes.length ) continue;
System.out.print(partes[p]);
}
System.out.println("");
}
closeLine();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void awk_start_end(String [] args)
{
String [] negativaStartEnd=getNegativaStartEnd(args);
if ( negativaStartEnd == null )
{
comando_invalido(args);
return;
}
String negativa=args[0]; // S/N
String start=args[1]; // ".." ou null
String end=args[2]; // ".." ou null
int status=0; // 0 -> fora, 1 -> dentro do range
try {
String line=null;
while ( (line=readLine()) != null ) {
if ( start != null && status == 0 && line.contains(start) )
status=1;
if (
(negativa.equals("S") && status == 0)
|| (negativa.equals("N") && status == 1)
)
System.out.println(line);
if ( end != null && status == 1 && line.contains(end) )
status=0;
}
closeLine();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void dev_null()
{
try{
byte[] buf = new byte[BUFFER_SIZE];
while(readBytes(buf) > -1){}
closeBytes();
}catch(Exception e){
System.out.println(e.toString());
}
}
public void dev_in()
{
while(true)
System.out.println(0);
}
public byte[] base64_B_B(byte[] txt,boolean encoding) throws Exception{ // byte in byte out
ByteArrayInputStream bais=new ByteArrayInputStream(txt);
ByteArrayOutputStream baos=new ByteArrayOutputStream();
base64(bais,baos,encoding);
return baos.toByteArray();
}
public String base64_S_S(String txt,boolean encoding) throws Exception{ // String in String out
return new String(base64_B_B(txt.getBytes(),encoding));
}
public String base64_B_S(byte[] txt,boolean encoding) throws Exception{ // byte in String out
return new String(base64_B_B(txt,encoding));
}
public byte[] base64_S_B(String txt,boolean encoding) throws Exception{ // String in byte out
return base64_B_B(txt.getBytes(),encoding);
}
public String base64(String txt,boolean encoding) throws Exception{
return base64_S_S(txt,encoding);
}
public void aes(String senha,boolean encoding,String md,byte[] salt){
try{
if ( encoding )
new AES().encrypt(System.in,System.out,senha,md,salt);
else
new AES().decrypt(System.in,System.out,senha,md);
}catch(Exception e){
System.err.println(e.toString());
System.err.println(erroSequenciaIlegal);
System.exit(1);
}
}
private static String bytesToHex(byte[] a){
StringBuilder sb = new StringBuilder();
for (byte b : a) {
sb.append(String.format("%02X", b));
}
return sb.toString();
}
private static byte[] hexTobytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i+1), 16));
}
return data;
}
public void base64(InputStream pipe_in,OutputStream pipe_out,boolean encoding) throws Exception{
// ex: base64(System.in,System.out,true);
if ( encoding )
base64encode(pipe_in,pipe_out);
else
base64decode(pipe_in,pipe_out);
}
public void base64encode(InputStream pipe_in,OutputStream pipe_out) throws Exception{
int BUFFER_SIZE_ = 1;
byte [] buf=new byte[BUFFER_SIZE_];
int len=-1;
int entrada=-1;
int agulha=0;
int agulha_count=0;
int indexPadding=61; // "="
while(true){
while( (len=pipe_in.read(buf,0,BUFFER_SIZE_)) == 0 ){}
if ( len == -1 ){
if ( agulha_count == 4 ){
pipe_out.write( indexBase64[ agulha<<2 ] );
pipe_out.write( indexPadding );
}
if ( agulha_count == 2 ){
pipe_out.write( indexBase64[ agulha<<4 ] );
pipe_out.write( indexPadding );
pipe_out.write( indexPadding );
}
break;
}
entrada=byte_to_int_java(buf[0],false);
agulha=(agulha<<8)|entrada;
agulha_count+=8;
while(agulha_count>=6){
if ( agulha_count == 6 ){
pipe_out.write( indexBase64[ agulha ] );
agulha=0;
agulha_count-=6;
continue;
}
if ( agulha_count == 8 ){
pipe_out.write( indexBase64[ (agulha & V_0b11111100)>>2 ] );
agulha&=V_0b00000011;
agulha_count-=6;
continue;
}
if ( agulha_count == 10 ){
pipe_out.write( indexBase64[ (agulha & V_0b1111110000)>>4 ] );
agulha&=V_0b0000001111;
agulha_count-=6;
continue;
}
if ( agulha_count == 12 ){
pipe_out.write( indexBase64[ (agulha & V_0b111111000000)>>6 ] );
agulha&=V_0b000000111111;
agulha_count-=6;
continue;
}
}
}
pipe_out.flush();
}
public void base64decode(InputStream pipe_in,OutputStream pipe_out) throws Exception{
int BUFFER_SIZE_ = 1;
byte [] buf=new byte[BUFFER_SIZE_];
int len=-1;
int entrada=-1;
int agulha=0;
int agulha_count=0;
int padding_count=0;
while(true){
while( (len=pipe_in.read(buf,0,BUFFER_SIZE_)) == 0 ){}
if ( len == -1 ){
if ( agulha_count == 0 && padding_count == 0 && agulha == 0 ){
break;
}
if ( agulha_count == 4 && padding_count == 2 && agulha == 0 ){
break;
}
if ( agulha_count == 2 && padding_count == 1 && agulha == 0 ){
break;
}
System.err.println(erroSequenciaIlegal);
System.exit(1);
break;
}
entrada=byte_to_int_java(buf[0],false);
// suprimindo \r\n
if ( entrada == 10 || entrada == 13 )
continue;
entrada=txtBase64.indexOf((char)entrada);
if ( entrada == -1 ){
System.err.println(erroSequenciaIlegal);
System.exit(1);
}
if ( entrada == 64 ){
padding_count++;
continue;
}
agulha=(agulha<<6)|entrada;
agulha_count+=6;
while(agulha_count>=8){
if ( agulha_count == 8 ){
pipe_out.write( agulha );
agulha=0;
agulha_count-=8;
continue;
}
if ( agulha_count == 10 ){
pipe_out.write( (agulha & V_0b1111111100)>>2 );
agulha&=V_0b0000000011;
agulha_count-=8;
continue;
}
if ( agulha_count == 12 ){
pipe_out.write( (agulha & V_0b111111110000)>>4 );
agulha&=V_0b000000001111;
agulha_count-=8;
continue;
}
}
}
pipe_out.flush();
}
public void comando_invalido(String[] args) {
//Comando inválido
System.err.print("Comando inválido: [y");
for ( int i=0;i<args.length;i++ )
System.err.print(" "+args[i]);
System.err.println("]");
}
public String[] sliceParm(int n, String[] args) {
String [] retorno=new String[args.length-n];
for ( int i=n;i<args.length;i++ )
retorno[i-n]=args[i];
return retorno;
}
public void createjobexecute(String conn) throws Exception {
String line;
String SQL="";
while ( (line=readLine()) != null )
SQL+=line+"\n";
closeLine();
System.out.print("jobexecute "); // funciona como orientador, não tem função prática
System.out.println(
base64(
"jobexecute\n"
+ "-conn\n"
+ conn+"\n"
+ "SQL\n"
+ SQL
,true
)
);
}
public void createjobcarga(String connIn, String fileCSV, String connOut, String outTable, String trunc, String app) throws Exception {
String line;
String SQL="";
while ( (line=readLine()) != null )
SQL+=line+"\n";
closeLine();
System.out.print("jobcarga "+outTable+" "); // funciona como orientador, não tem função prática
System.out.println(
base64(
"jobcarga\n"
+ "-connIn\n"
+ connIn+"\n"
+ "-fileCSV\n"
+ fileCSV+"\n"
+ "-connOut\n"
+ connOut+"\n"
+ "-outTable\n"
+ outTable+"\n"
+ "trunc\n"
+ trunc+"\n"
+ "SQL\n"
+ SQL
,true
)
);
}
public void carga(final String connIn,final String fileCSV,final String connOut,final String outTable,final String trunc){
final String nemVouExplicar=trunc.equals("CREATETABLE")?connOut:"";
if ( outTable.trim().equals("") )
{
System.err.println("Erro, outTable não preenchido!");
return;
}
if ( ! trunc.equals("S") && ! trunc.equals("N") && ! trunc.equals("CREATETABLE") )
{
System.err.println("Erro, inesperado!");
return;
}
try{
final PipedInputStream pipedInputStream=new PipedInputStream();
final PipedOutputStream pipedOutputStream=new PipedOutputStream();
// construção da variavel select(o select pode ser customizado)
// em CSV nao tem select
String select_="";
if ( !connIn.equals("") ){
String line;
while( (line=readLine()) != null )
select_+=line+"\n";
closeLine();
select_=removePontoEVirgual(select_);
}
final String select=select_;
pipedInputStream.connect(pipedOutputStream);
if ( trunc.equals("S") && ! execute(connOut, "truncate table "+outTable) )
return;
if ( trunc.equals("CREATETABLE") && !connIn.equals("") )
{
String tabela=getTableByParm(select);
if ( tabela.equals("") ){
System.err.println("Erro, não foi possível encontrar o nome da tabela");
System.exit(1);
}
String create=getcreate(connIn,tabela,outTable);
if ( create.contains("USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS") )
{
System.err.println("Erro, não foi possível pegar o metadata a partir de "+tabela+" segue comando: "+create);
System.exit(1);
}
if ( create.equals("") ){
System.err.println("Erro, não foi possível pegar o metadata a partir de "+tabela);
System.exit(1);
}
if ( !connIn.equals("") )
{
if ( ! execute(connOut, create) )
return;
}else{
// será feito pelo nemVouExplicar
}
}
Thread pipeWriter=new Thread(new Runnable() {
public void run() {
selectInsert(connIn,fileCSV,select,pipedOutputStream,outTable,nemVouExplicar);
}
});
Thread pipeReader=new Thread(new Runnable() {
public void run() {
executeInsert(connOut, pipedInputStream);
}
});
pipeWriter.start();
pipeReader.start();
pipeWriter.join();
pipeReader.join();
pipedOutputStream.flush();
pipedOutputStream.close();
pipedInputStream.close();
}catch(Exception e){
System.err.println("Erro, "+e.toString());
}
}
public void executejob() {
try{
String line;
String hash="";
String [] partes;
ArrayList<Thread> threads = new ArrayList<Thread>();
String value_="";
String [] sub_linesjob;
while ( (line=readLine()) != null ){
line=line.trim();
if ( line.equals("") ) continue;
if ( line.contains(" ") ){
partes=line.split(" ");
// jobcarga
if ( partes.length == 3 && partes[0].equals("jobcarga") )
hash=partes[2];
// jobexecute
if ( hash.equals("") && partes.length == 2 && partes[0].equals("jobexecute") )
hash=partes[1];
if ( hash.equals("") )
{
System.err.println("Erro, comando inválido:" + line);
return;
}
value_=base64(hash,false);
if ( value_ == null )
{
System.err.println("Erro, comando inválido:" + line);
return;
}
final ArrayList<String> instrucoes = new ArrayList<String>();
String SQL="";
sub_linesjob=value_.split("\n");
for ( int i=0;i<sub_linesjob.length; )
{
if ( sub_linesjob[i].equals("SQL") ){
instrucoes.add(sub_linesjob[i]);
i++;
for ( ;i<sub_linesjob.length; ){
SQL+=sub_linesjob[i]+"\n";
i++;
}
instrucoes.add(SQL);
}else{
instrucoes.add(sub_linesjob[i]);
}
i++;
}
/*
"jobcarga\n"
+ "-connIn\n"
+ connIn+"\n"
+ "-connOut\n"
+ connOut+"\n"
+ "-outTable\n"
+ outTable+"\n"
+ "trunc\n"
+ trunc+"\n"
+ "SQL\n"
+ SQL
*/
if ( instrucoes.size() == 11
&& instrucoes.get(0).equals("jobcarga")
&& instrucoes.get(1).equals("-connIn")
&& instrucoes.get(3).equals("-fileCSV")
&& instrucoes.get(5).equals("-connOut")
&& instrucoes.get(7).equals("-outTable")
&& instrucoes.get(9).equals("trunc")
&& instrucoes.get(11).equals("SQL")
&& ! instrucoes.get(12).equals("")
){
threads.add(
new Thread(new Runnable() {
public void run() {
carga(
instrucoes.get(2)
,instrucoes.get(4)
,instrucoes.get(6)
,instrucoes.get(8)
,instrucoes.get(10)
);
}
})
);
continue;
}
/*
"jobexecute\n"
+ "-conn\n"
+ conn+"\n"
+ "SQL\n"
+ SQL
*/
if ( instrucoes.size() == 5
&& instrucoes.get(0).equals("jobexecute")
&& instrucoes.get(1).equals("-conn")
&& instrucoes.get(3).equals("SQL")
&& ! instrucoes.get(4).equals("")
){
threads.add(
new Thread(new Runnable() {
public void run() {
execute(
instrucoes.get(2)
,instrucoes.get(4)
);
}
})
);
continue;
}
System.err.println("Erro, comando inválido:" + line);
return;
}
for ( int i=0;i<threads.size();i++ )
threads.get(i).start();
for ( int i=0;i<threads.size();i++ )
threads.get(i).join();
}
closeLine();
}catch(Exception e){
System.err.println("Erro, "+e.toString());
}
}
public static String formatacaoInsertClobComAspetas(String _text)
{
String retorno = "";
int len = 0;
while (_text.length() > 0 )
{
if (_text.length() > 3000)
len = 3000;
else
len = _text.length();
retorno +=
(retorno.equals("") ? "" : " || ")
+ " to_clob('" + _text.substring(0, len).replace("'", "''") + "') ";
if (_text.length() <= 3000)
_text = "";
else
_text = _text.substring(len);
}
return retorno;
}
private String getcreate(String connIn, String tabela, String outTable) {
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
String schema="";
String tabela_=tabela;
if ( tabela.contains(".") ){
schema=tabela.split("\\.")[0];
tabela=tabela.split("\\.")[1];
}
String SQL=lendo_arquivo_pacote("/y/sql_get_ddl_createtable").replace("[TABELA]",tabela).replace("[SCHEMA]",schema);
try{
String retorno="";
con = getcon(connIn);
if ( con == null ){
System.err.println("Não foi possível se conectar!!" );
return "";
}
stmt = con.createStatement();
rs=null;
rs=stmt.executeQuery(SQL);
if ( rs.next() ){
retorno=rs.getString("TXT");
}
close(rs,stmt,con);
if ( ! retorno.equals("") ){
retorno=removePontoEVirgual(retorno);
retorno=retorno.trim();
String [] partes=retorno.split("\n");
retorno="CREATE TABLE "+outTable+"\n";
for ( int i=1;i<partes.length;i++ )
retorno+=partes[i]+"\n";
if ( retorno.contains("USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS") )
return tryFixCreate(retorno);
return retorno;
}
}
catch(Exception e)
{
if ( e.toString().contains("ORA-31603") )
{
System.err.println("Erro, a tabela "+tabela_+" não foi encontrada!");
close(rs,stmt,con);
System.exit(1);
}
close(rs,stmt,con);
return "";
}
close(rs,stmt,con);
return "";
}
private String tryFixCreate(String txt) {
String retorno="";
String [] partes=txt.split("\n");
retorno=partes[0]+"\n";
retorno+=partes[1]+"\n";
for ( int i=2;i<partes.length;i++ )
{
if ( ! partes[i].trim().startsWith("\"") )
break;
retorno+=partes[i]+"\n";
}
retorno=retorno.trim();
retorno=retorno.substring(0,retorno.length()-1)+")";
return retorno;
}
private void close(ResultSet rs, Statement stmt, Connection con) {
try{
rs.close();
}catch(Exception e){}
try{
stmt.close();
}catch(Exception e){}
try{
con.close();
}catch(Exception e){}
}
private void try_finish_and_count(long count) {
// grava em arquivo uma sinalização de sim e count
String caminho_status_fim=System.getenv("STATUS_FIM_Y");
String caminho_count=System.getenv("COUNT_Y");
if ( caminho_status_fim != null && ! caminho_status_fim.equals("") ){
salvando_file("FIM\n",new File(caminho_status_fim));
}
if ( caminho_count != null && ! caminho_count.equals("") ){
salvando_file(count+"\n",new File(caminho_count));
}
}
public String somente_banco(String a){
String [] linhas=lendo_arquivo_pacote(a).split("\n");
String result="";
int tag=0;
for ( int i=0;i<linhas.length;i++ ){
if ( linhas[i].startsWith(" ") && linhas[i].trim().startsWith("[y ") && !linhas[i].trim().startsWith("[y banco ") ) continue;
if ( linhas[i].startsWith("[y ") ){
if ( linhas[i].startsWith("[y banco ") )
tag=1;
else
tag=2;
}
if ( tag > 0 && linhas[i].trim().equals("") )
tag=0;
if ( tag == 2 ) continue;
result+=linhas[i]+"\n";
}
return result;
}
public String helplike(String txt){
String retorno=helplikecase(txt,true);
if ( retorno.equals("") )
retorno=helplikecase(txt,false);
if ( retorno.equals("") )
return null;
return retorno;
}
public String helplikecase(String txt, boolean case_){
String [] linhas=somente_detalhado().split("\n");
String result="";
boolean achou=false;
for ( int i=0;i<linhas.length;i++ ){
if ( linhas[i].startsWith("[") ){
achou=false;
if (
(case_ && linhas[i].equals("[y "+txt+"]"))
|| (!case_ && linhas[i].toUpperCase().contains(txt.toUpperCase()))
)
achou=true;
}
if ( achou )
result+=linhas[i]+"\n";
}
return result;
}
public String somente_detalhado(){
String [] linhas=lendo_arquivo_pacote("/y/manual").split("\n");
String result="";
int count=0;
for ( int i=0;i<linhas.length;i++ ){
if ( count == 2 )
result+=linhas[i]+"\n";
if ( linhas[i].trim().equals("") )
count++;
if ( count == 3 )
break;
}
return result;
}
public String somente_mini(String a){
String [] linhas=lendo_arquivo_pacote(a).split("\n");
String result="";
for ( int i=0;i<linhas.length;i++ ){
result+=linhas[i]+"\n";
if ( linhas[i].trim().equals("") )
break;
}
return result;
}
public String lendo_arquivo_pacote(String caminho){
// System.out.println(
// lendo_arquivo_pacote("/y/manual")
// );
String result="";
try{
readLine(getClass().getResourceAsStream(caminho));
String strLine;
while ((strLine = readLine()) != null)
result+=strLine+"\n";
closeLine();
return result;
}catch (Exception e){}
return new Arquivos().lendo_arquivo_pacote(caminho);
}
public void MetodoGaranteAPermanenciaDeAlgunsImportsJava()
{
FilterOutputStream a;
IOException b;
OutputStream c;
ByteBuffer d;
Charset e;
Arrays f;
Comparator g;
}
private static String getSeparadorCSV(){
String sep_=System.getenv("CSV_SEP_Y");
if ( sep_ == null || sep_.trim().equals("") )
sep_=";";
return sep_;
}
private String [] getCamposCSV(String txt) {
// modelos
// HEADER_CAMPO1;BB;CC;3;4;5;
// HEADER_CAMPO1;BB;CC;3;4;5
txt=txt.trim();
if ( txt.endsWith(sepCSV) )
txt=txt.substring(0, txt.length()-1);
return txt.replace("\"","").split( sepCSV.equals("|")?"\\|":sepCSV ); // split nao funciona com |, tem que usar \\|
}
private void readColunaCSV(String line) {
ponteiroLinhaCSV=0;
linhaCSV=line;
}
private String readColunaCSV() {
if ( linhaCSV.length() == 0 )
return null;
if ( ponteiroLinhaCSV == -1 )
return null;
if ( ponteiroLinhaCSV >= linhaCSV.length() )
return null;
if ( linhaCSV.substring(ponteiroLinhaCSV, ponteiroLinhaCSV+1).equals("\"") )
{
return readColunaCSVComplexa();
}else{
return readColunaCSVSimples();
}
// linhaCSV
/*
HEADER_CAMPO1;BB;CC;3;4;5;
11;;";;""""""11';;";55;55;55
11;;";;""""""11';;";55;55;55
11;;";;""""""11';;";55;55;55;
33;44
33;44
33;44;44;44;44;44;44;44;44;44;44;44;44;44;44;44
33;44;44;44;44;44;44;44;44;44;44;44;44;44;44;44
*/
}
private String readColunaCSVComplexa() { // exmeplo ";;""""""11';;"
if ( ponteiroLinhaCSV >= linhaCSV.length()-2 )
return null;
int ini=ponteiroLinhaCSV+1;
int fim=-1;
int pos=ponteiroLinhaCSV+1; // olhando adiantado
int pos_=-1;
while(true)
{
pos_=linhaCSV.indexOf("\"",pos);
if ( pos_ == -1 )
{
System.err.println("Erro: CSV inválido, linha inconsistente: "+linhaCSV);
System.exit(1);
}
if ( linhaCSV.indexOf("\"",pos_+1) == pos_+1 ){
pos=pos_+2;
continue;
}
fim=pos_;
ponteiroLinhaCSV=pos_+2;
break;
}
return linhaCSV.substring(ini,fim).replace("\r","").replace("\n","");
}
private String readColunaCSVSimples() {
if ( linhaCSV.indexOf(sepCSV,ponteiroLinhaCSV) == ponteiroLinhaCSV )
{
ponteiroLinhaCSV++;
return "";
}
int pos=linhaCSV.indexOf(sepCSV,ponteiroLinhaCSV+1);
int ini=ponteiroLinhaCSV;
int fim=-1;
if ( pos == -1 )
{
fim=linhaCSV.length();
ponteiroLinhaCSV=-1;
}else{
fim=pos;
ponteiroLinhaCSV=pos+1;
}
return linhaCSV.substring(ini,fim).replace("\r","").replace("\n","");
}
private String getCreateByCamposCSV(String[] camposCSV, String table) {
String result="CREATE TABLE "+table+" (";
for ( int i=0;i<camposCSV.length;i++ ){
result+=" \""+camposCSV[i]+"\" varchar2(4000)";
if ( i != camposCSV.length-1 )
result+=",";
}
result+=")";
return result;
}
private void scp(String[] args) {
// créditos
// https://github.com/is/jsch/tree/master/examples
int port=22;
if ( args.length != 3 && args.length != 4 )
{
comando_invalido(args);
return;
}
if (
( args[1].contains("@") && args[2].contains("@") )
|| ( !args[1].contains("@") && !args[2].contains("@") )
){
comando_invalido(args);
return;
}
if ( args.length == 4 )
{
try{
port=Integer.parseInt(args[3]);
}catch(Exception e){
comando_invalido(args);
return;
}
}
String[] senha=new String[]{""};
pedeSenhaCasoNaoTenha(args,senha);
if ( args[1].contains("@") )
new JSchCustom().scpFrom(new String[]{args[1],args[2]},senha[0],port);
else
new JSchCustom().scpTo(new String[]{args[1],args[2]},senha[0],port);
System.exit(0);
}
private void execSsh(String[] args) {
// créditos
// https://github.com/is/jsch/tree/master/examples
int port=22;
if ( args.length != 3 && args.length != 4 )
{
comando_invalido(args);
return;
}
if ( !args[1].contains("@") )
{
comando_invalido(args);
return;
}
if ( args.length == 4 )
{
try{
port=Integer.parseInt(args[3]);
}catch(Exception e){
comando_invalido(args);
return;
}
}
String[] senha=new String[]{""};
pedeSenhaCasoNaoTenha(args,senha);
new JSchCustom().execSsh(new String[]{args[1],args[2]},senha[0],port);
System.exit(0);
}
private void ssh(String[] args) {
// créditos
// https://github.com/is/jsch/tree/master/examples
int port=22;
if ( args.length != 2 && args.length != 3 )
{
comando_invalido(args);
return;
}
if ( !args[1].contains("@") )
{
comando_invalido(args);
return;
}
if ( args.length == 3 )
{
try{
port=Integer.parseInt(args[2]);
}catch(Exception e){
comando_invalido(args);
return;
}
}
String[] senha=new String[]{""};
pedeSenhaCasoNaoTenha(args,senha);
new JSchCustom().ssh(new String[]{args[1]},senha[0],port);
System.exit(0);
}
private void sftp(String[] args) {
// créditos
// https://github.com/is/jsch/tree/master/examples
int port=22;
if ( args.length != 2 && args.length != 3 )
{
comando_invalido(args);
return;
}
if ( !args[1].contains("@") )
{
comando_invalido(args);
return;
}
if ( args.length == 3 )
{
try{
port=Integer.parseInt(args[2]);
}catch(Exception e){
comando_invalido(args);
return;
}
}
String[] senha=new String[]{""};
pedeSenhaCasoNaoTenha(args,senha);
new JSchCustom().sftp(new String[]{args[1]},senha[0],port);
System.exit(0);
}
public void pedeSenhaCasoNaoTenha(String [] args,String [] senha){
// ywanes@desktop's password:
// String password = new String(console.readPassword("Password: "));
for( int i=0;i<args.length;i++ ){
if( args[i].contains("@") ){
if ( args[i].startsWith("@") || args[i].endsWith("@") ){
System.out.println("Error command");
System.exit(1);
}
if ( args[i].contains(",") ){
int p_virgula=args[i].indexOf(",");
int p_ultima_arroba=args[i].length()-1;
while(!args[i].substring(p_ultima_arroba,p_ultima_arroba+1).equals("@"))
p_ultima_arroba--;
String user=args[i].substring(0,p_virgula);
senha[0]=args[i].substring(p_virgula+1,p_ultima_arroba);
String host=args[i].substring(p_ultima_arroba+1,args[i].length());
args[i]=user+"@"+host;
}else{
java.io.Console console=System.console();
if ( console == null ){
System.out.println("Error, input nao suportado nesse ambiente, rodando no netbeans?...");
System.exit(1);
}
String user_server_print=args[i];
if ( user_server_print.contains(":") )
user_server_print=user_server_print.split(":")[0];
String password=null;
char [] passChar = System.console().readPassword(user_server_print+"'s password: ");
if ( passChar != null )
password = new String(passChar);
if ( password == null || password.trim().equals("") ){
System.out.println("Error, not input found");
System.exit(1);
}
senha[0]=password;
}
break;
}
}
}
private void serverRouter(String[] args) {
if ( args.length == 5 ){
new Ponte().serverRouter(args[1],Integer.parseInt(args[2]),args[3],Integer.parseInt(args[4]),"");
return;
}
if ( args.length == 6 && (
args[5].equals("show")
|| args[5].equals("showOnlySend")
|| args[5].equals("showOnlyReceive")
|| args[5].equals("showSimple")
) ){
new Ponte().serverRouter(args[1],Integer.parseInt(args[2]),args[3],Integer.parseInt(args[4]),args[5]);
return;
}
comando_invalido(args);
System.exit(0);
}
private void TESTEserver(String[] args) {
if ( args.length == 2 ){
new Ponte().TESTEserver(null,Integer.parseInt(args[1]));
return;
}
if ( args.length == 3 ){
new Ponte().TESTEserver(args[1],Integer.parseInt(args[2]));
return;
}
comando_invalido(args);
System.exit(0);
}
private void TESTEclient(String[] args) {
if ( args.length == 3 ){
new Ponte().TESTEclient(args[1],Integer.parseInt(args[2]));
return;
}
comando_invalido(args);
System.exit(0);
}
public static int byte_to_int_java(byte a,boolean dif_128) {
// os bytes em java vem 0..127 e -128..-1 totalizando 256
// implementacao manual de Byte.toUnsignedInt(a)
// dif_128 true => -128..127
// dif_128 false => 0..255
int i=(int)a;
if ( !dif_128 && i < 0 )
i+=256;
return i;
}
ArrayList<String> xlsxToCSV_nomes=null;
ArrayList<String> shared=null;
private void xlsxToCSV(String caminhoXlsx, boolean mostraEstrutura, boolean listaAbas, int numeroAba, String nomeAba, OutputStream out, boolean suprimeHeader) throws Exception {
//"C:\\Users\\ywanes\\Documents\\teste.xlsx"
//xlsxToCSV arquivo.xlsx mostraEstrutura
//xlsxToCSV arquivo.xlsx listaAbas
//xlsxToCSV arquivo.xlsx numeroAba 1
//xlsxToCSV arquivo.xlsx nomeAba Planilha1
try{
ZipFile zipFile = new ZipFile(caminhoXlsx);
Enumeration<? extends ZipEntry> enumeration_entries = zipFile.entries();
InputStream is=null;
String caminho="";
XML xmlShared=null;
XML xmlNomes=null;
int sheet_count=0;
boolean exportSheetCSV=false;
int sheetEncontrados=0;
//XML xml=null;
//String atributo_t=null;
ArrayList<ZipEntry> entries=new ArrayList<ZipEntry>();
while(enumeration_entries.hasMoreElements()){
ZipEntry z=enumeration_entries.nextElement();
if ( z.getName().equals("xl/sharedStrings.xml") ) // "xl/sharedStrings.xml" precisa ser carregado antes das "xl/worksheets/"
entries.add(0,z);
else
entries.add(z);
}
for ( ZipEntry entry : entries){
caminho=entry.getName();
if ( caminho.equals("xl/sharedStrings.xml") || caminho.equals("xl/workbook.xml") || caminho.startsWith("xl/worksheets/") ){
// xl/worksheets/sheet1.xml
// xl/worksheets/sheet2.xml
// xl/sharedStrings.xml
// xl/worksheets/_rels/sheet2.xml.rels
// xl/workbook.xml
if ( caminho.equals("xl/workbook.xml") && xlsxToCSV_nomes != null )
continue; // conteudo ja carregado.
if ( caminho.equals("xl/sharedStrings.xml") && shared != null )
continue; // conteudo ja carregado.
if ( caminho.startsWith("xl/worksheets/") && caminho.endsWith("xml") && listaAbas )
continue;
exportSheetCSV=false;
if ( caminho.startsWith("xl/worksheets/") && caminho.endsWith("xml") && !mostraEstrutura && !listaAbas ){
if ( xlsxToCSV_nomes.size() == 0 )
XML.ErroFatal(99);
if ( numeroAba == -1 && nomeAba.equals(xlsxToCSV_nomes.get(sheet_count)) ){
exportSheetCSV=true;
}
if ( numeroAba != -1 && numeroAba == sheet_count+1 ){
exportSheetCSV=true;
}
sheet_count++;
if ( ! exportSheetCSV )
continue;
sheetEncontrados++;
}
is = zipFile.getInputStream(entry);
XML.loadIs(is,mostraEstrutura,false,caminho,exportSheetCSV,out,suprimeHeader);
is.close();
// carrega lista de abas
if ( caminho.equals("xl/workbook.xml") && !mostraEstrutura ){
xlsxToCSV_nomes=new ArrayList<String>();
xmlNomes=XML.getXML();
for ( XML item1 : xmlNomes.getFilhos())
if ( item1.getTag().equals("sheets") )
for ( XML item2 : item1.getFilhos())
xlsxToCSV_nomes.add(item2.getAtributo("name"));
}
// carrega dicionario de palavras compartilhadas
if ( caminho.equals("xl/sharedStrings.xml") && !mostraEstrutura && !listaAbas ){
shared=new ArrayList<String>();
xmlShared=XML.getXML();
for ( XML item1 : xmlShared.getFilhos()){
for ( XML item2 : item1.getFilhos()){
if(item2.getTag().equals("t")){
shared.add(item2.getValue());
}
}
}
XML.shared=shared;
}
}
}
if ( !mostraEstrutura && !listaAbas && sheetEncontrados==0 ){
if ( numeroAba != -1 )
System.err.println("Erro, numeroAba: "+numeroAba+" não encontrada!");
else
System.err.println("Erro, nomeAba: "+nomeAba+" não encontrada!");
System.exit(1);
}
}catch(Exception e){
System.err.println("Erro "+e.toString());
System.exit(1);
}
// finalizacao será feita no chamador de xlsxToCSV
/*if ( out != null ){
out.flush();
out.close();
}*/
}
public static byte[] readAllBytes(String path) throws IOException {
java.io.RandomAccessFile f = new java.io.RandomAccessFile(new File(path), "r");
if (f.length() > Integer.MAX_VALUE)
throw new IOException("File is too large");
byte[] b = new byte[(int)f.length()];
f.readFully(b);
if (f.getFilePointer() != f.length())
throw new IOException("File length changed while reading");
return b;
}
private void copiaByStream(InputStream pipe_in, OutputStream pipe_out) throws Exception {
byte[] buf = new byte[BUFFER_SIZE];
int len;
while ((len = pipe_in.read(buf)) > -1)
pipe_out.write(buf, 0, len);
pipe_out.flush();
pipe_out.close();
}
private void interpretaSqlParaSelectCSV(String sqlText) throws Exception {
String sqlTextBKP=sqlText;
if ( ! sqlText.startsWith("select ") )
throw_erroDeInterpretacaoDeSQL("ORAZ: 01 - Não foi possível interpretar o SQL: "+sqlTextBKP);
// remove "select "
sqlText=sqlText.substring("select ".length());
if ( ! sqlText.endsWith(" from this") )
throw_erroDeInterpretacaoDeSQL("ORAZ: 02 - Não foi possível interpretar o SQL: "+sqlTextBKP);
// remove
sqlText=sqlText.substring(0,sqlText.length()-" from this".length());
sqlText=sqlText.trim();
if ( sqlText.equals("") )
throw_erroDeInterpretacaoDeSQL("ORAZ: 03 - Não foi possível interpretar o SQL: "+sqlTextBKP);
if ( sqlText.equals("*") ){
selectCSV_camposNameSaida=selectCSV_camposName;
selectCSV_camposNameSaidaAlias=selectCSV_camposName;
selectCSV_tratativasWhere=new String[]{};
return;
}
String [] partes=sqlText.split(",");
for ( int i=0;i<partes.length;i++ )
partes[i]=partes[i].trim();
selectCSV_camposNameSaida=partes;
selectCSV_camposNameSaidaAlias=partes;
selectCSV_tratativasWhere=new String[]{};
}
private void processaRegistroSqlParaSelectCSV(OutputStream out) throws Exception {
StringBuilder sb=new StringBuilder();
boolean achou=false;
for ( int i=0;i<selectCSV_camposNameSaida.length;i++ ){
sb.append("\"");
achou=false;
for ( int j=0;j<selectCSV_camposName.length;j++ ){
if ( selectCSV_camposNameSaida[i].equals(selectCSV_camposName[j]) ){
achou=true;
if ( selectCSV_camposValue[j] != null )
sb.append(selectCSV_camposValue[j]);
break;
}
}
if ( ! achou )
throw_erroDeInterpretacaoDeSQL("ORAZ: 99 - Não foi possível interpretar o campo: "+selectCSV_camposNameSaida[i]);
if ( i < selectCSV_camposNameSaida.length-1 )
sb.append("\";");
else
sb.append("\"");
}
// implementar where depois
sb.append("\n");
out.write(sb.toString().getBytes());
}
private void throw_erroDeInterpretacaoDeSQL(String string) throws Exception {
throw new Exception(string);
}
private String get_abaSequencial(ArrayList<String> bkp_lista) {
if ( bkp_lista.size() > 1 && bkp_lista.get(0).length() > 3 && bkp_lista.get(0).endsWith("(1)") ){
String tmp=bkp_lista.get(0).substring(0,bkp_lista.get(0).length()-3);
for ( int i=1;i<bkp_lista.size();i++ ){
if ( ! bkp_lista.get(i).equals(tmp+"("+(i+1)+")") )
return null;
}
return tmp;
}
return null;
}
// tipos de retorno
// file1|D:\pasta1\file1.class
// pacote1.file1|D:\pacote1\file1.class
private ArrayList<String> nav_custom(String dir){
// dir possiveis
// .
// pasta
// pasta\\
// d:\\aa
if ( dir.equals("") ) dir=".";
dir=new File(dir).getAbsolutePath();
String sep="/";
if ( dir.contains("\\") )
sep="\\";
if ( dir.endsWith(sep+".") )
dir=dir.substring(0,dir.length()-2);
return nav_custom(dir,"",sep);
}
private ArrayList<String> nav_custom(String dir1, String dir2, String sep) {
ArrayList<String> retorno=new ArrayList<String>();
for ( File item : new java.io.File(dir1+dir2).listFiles() ){
if ( !item.isFile() ) continue;
if ( !item.getAbsolutePath().endsWith(".class") ) continue;
String tmp=item.getAbsolutePath().substring(dir1.length()+1);
tmp=tmp.substring(0,tmp.length()-".class".length());
tmp=tmp.replace(sep,".");
retorno.add(
tmp
+"|"
+item.getAbsolutePath()
);
}
for ( File item : new java.io.File(dir1+dir2).listFiles() ){
if ( !item.isDirectory() ) continue;
retorno.addAll(nav_custom(dir1,dir2+sep+item.getName(),sep));
}
return retorno;
}
private void wget(String[] args) {
args=sliceParm(1,args);
if ( args.length == 0 )
args=new String[]{"-h"};
Wget w=new Wget();
for ( String comando : args)
w.comando(comando);
try {
w.start_motor();
} catch (Exception ex) {
System.err.println("Error: "+ex.toString());
}
}
private boolean tipo_cadastrado(int a) {
return true;
// controle desabilitado - ja foram feitos muitos testes...
// return a == -9 || a == -5 || a == -3 || a == -1 || a == 1 || a == 2 || a == 3 || a == 4 || a == 12 || a == 93 || a == 2005;
}
private boolean tipo_numerico(int a) {
return a == 2 || a == 3 || a == 4;
}
}
class Ponte {
//exemplo
//new Ponte().serverRouter("192.168.0.100",8080,"192.168.0.200",9090,"");
//new Ponte().serverRouter("192.168.0.100",8080,"192.168.0.200",9090,"show");
//new Ponte().serverRouter("192.168.0.100",8080,"192.168.0.200",9090,"showOnlySend");
//new Ponte().serverRouter("192.168.0.100",8080,"192.168.0.200",9090,"showOnlyReceive");
// teste server
//new Ponte().TESTEserver("9090");
// teste client
//new Ponte().TESTEclient("localhost","8080");
public void serverRouter(final String host0,final int port0,final String host1,final int port1,final String typeShow){
Ambiente ambiente=null;
try{
ambiente=new Ambiente(host0,port0);
}catch(Exception e){
System.out.println("Nao foi possível utilizar a porta "+port0+" - "+e.toString());
System.exit(1);
}
System.out.println("ServerRouter criado.");
System.out.println("obs: A ponte só estabelece conexão com o destino quando detectar o início da origem");
while(true){
try{
final Socket credencialSocket=ambiente.getCredencialSocket();
new Thread(){
public void run(){
ponte0(credencialSocket,host1,port1,typeShow);
}
}.start();
}catch(Exception e){
System.out.println("FIM");
break;
}
}
}
private void ponte0(Socket credencialSocket, String host1, int port1,String typeShow) {
String id=padLeftZeros(new Random().nextInt(100000)+"",6);
System.out.println("iniciando ponte id "+id);
Origem origem=null;
try{
Destino destino=new Destino(host1,port1);
origem=new Origem(credencialSocket,id,typeShow);
origem.referencia(destino);
destino.referencia(origem);
origem.start(); // destino é startado no meio do start da origem;
}catch(Exception e){
System.out.println("termino inexperado de ponte id "+id+" - "+e.toString());
origem.destroy();
}
System.out.println("finalizando ponte id "+id);
}
public static class OutputStreamCustom{
public static int IDA=1;
public static int VOLTA=2;
private OutputStream os=null;
private OutputStreamCustom(OutputStream os) {
this.os=os;
}
public void write(int sentido_, byte[] buffer, int off, int len) throws IOException {
os.write(buffer, off, len);
}
}
private class Destino {
OutputStreamCustom os=null;
Origem origem=null;
String host1;
int port1;
private Destino(String host1, int port1) {
this.host1=host1;
this.port1=port1;
}
private void referencia(Origem origem) {
this.origem=origem;
}
private void start() throws Exception {
Socket socket=new Socket(host1, port1);
final InputStream is=socket.getInputStream();
os=new OutputStreamCustom(socket.getOutputStream());
new Thread(){
public void run(){
int len=0;
byte[] buffer = new byte[2048];
try{
while( (len=is.read(buffer)) > -1 )
origem.volta(len,buffer);
}catch(Exception e){
System.out.println("desconectou destino "+e.toString());
}
}
}.start();
}
private void ida(byte[] buffer,int len) throws Exception {
os.write(OutputStreamCustom.IDA,buffer,0,len);
}
}
private class Origem {
String ponteID="";
Socket socket=null;
OutputStreamCustom os=null;
Destino destino=null;
boolean displayIda=false;
boolean displayVolta=false;
boolean displaySimple=false;
int port0;
private Origem(Socket credencialSocket,String ponteID,String typeShow) {
socket=credencialSocket;
this.ponteID=ponteID;
if ( typeShow.equals("show") || typeShow.equals("showOnlySend") || typeShow.equals("showSimple"))
displayIda=true;
if ( typeShow.equals("show") || typeShow.equals("showOnlyReceive") || typeShow.equals("showSimple"))
displayVolta=true;
if ( typeShow.equals("showSimple") )
displaySimple=true;
}
private void referencia(Destino destino) {
this.destino=destino;
}
private void start() throws Exception {
// start destino
destino.start();
int len=0;
byte[] buffer = new byte[2048];
InputStream is=null;
os=null;
BufferedInputStream bis=null;
is=socket.getInputStream();
os=new OutputStreamCustom(socket.getOutputStream());
bis=new BufferedInputStream(is);
while( (len=bis.read(buffer)) != -1 ){
// local de filtro ida
if (displayIda)
mostra(len,"->",ponteID,buffer);
destino.ida(buffer,len);
}
try{ bis.close(); }catch(Exception e){}
try{ is.close(); }catch(Exception e){}
}
private void volta(int len,byte[] buffer) throws Exception {
// local de filtro volta
if (displayVolta)
mostra(len,"<-",ponteID,buffer);
os.write(OutputStreamCustom.VOLTA,buffer,0,len);
}
private void destroy() {
try{
socket.close();
}catch(Exception e){}
}
private void mostra(int len,String direcao, String ponteID, byte[] buffer) {
if (displaySimple){
System.out.println(direcao.replace("->","1 ").replace("<-","2 ")+ponteID+" "+cleanTextContent(new String(buffer,0,len)));
}else{
// INT
System.out.println(
direcao+"(id "+ponteID+" int):"
+getInts(buffer,len)
);
// STR
for (String parte : new String(buffer,0,len).split("\n") )
System.out.println(direcao+"(id "+ponteID+" str):"+parte);
}
}
private String cleanTextContent(String text)
{
// strips off all non-ASCII characters
text = text.replaceAll("[^\\x00-\\x7F]", " ");
// erases all the ASCII control characters
text = text.replaceAll("[\\p{Cntrl}&&[^\r\n\t]]", " ");
// removes non-printable characters from Unicode
text = text.replaceAll("\\p{C}", " ");
return text.replace("$"," ").trim();
}
private String getInts(byte[] buffer,int len) {
int count=0;
StringBuilder sb=new StringBuilder();
for (byte b : buffer){
sb.append(Y.OD_BC_R[Y.byte_to_int_java(b,false)]);
if ( ++count >= len )
break;
}
return sb.toString();
}
private String getHexs(byte[] buffer,int len) {
int count=0;
StringBuilder sb=new StringBuilder();
for (byte b : buffer){
sb.append(String.format("%02X",Y.byte_to_int_java(b,false)));
if ( ++count >= len )
break;
}
return sb.toString();
}
}
// preparando para receber varias conexoes
public void TESTEserver(String host,int port){
try{
// exemplo host0 -> "192.168.0.100"
if ( host == null || host.equals("localhost") ){
try{
host=InetAddress.getLocalHost().getHostName();
}catch(Exception e){
System.out.println("warning: procurando ip ...");
host=getListaIPs().get(0);
System.out.println("warning: ip localizado -> "+host);
}
}
ServerSocket serverSocket = new ServerSocket(port, 1,InetAddress.getByName(host));
System.out.println("servidor porta "+port+" criado.");
while (true) {
final Socket socket=serverSocket.accept();
System.out.println("recebendo conexao..");
new Thread(){
public void run(){
try {
TESTEserver0(socket);
} catch (Exception e) {
System.out.println("Erro ao executar servidor:" + e.toString());
}
System.out.println("finalizando conexao..");
}
}.start();
}
}catch(Exception e){
System.out.println(e.toString());
}
}
// operando uma unica comunicação
private void TESTEserver0(Socket socket) throws Exception{
int len=0;
byte[] buffer = new byte[2048];
InputStream is=null;
BufferedInputStream bis=null;
is = socket.getInputStream();
bis=new BufferedInputStream(is);
while( (len=bis.read (buffer)) != -1 )
{
System.out.println(
new String(buffer)
);
}
try{ bis.close(); }catch(Exception e){}
try{ is.close(); }catch(Exception e){}
}
public void TESTEclient(String host, int port){
try{
System.out.println("cliente iniciado.");
OutputStream os=null;
Socket socket=new Socket(host, port);
os=socket.getOutputStream();
os.write(new byte[]{1,2,3,70});
try {Thread.sleep(3000);}catch (Exception e) { }
os.write(new byte[]{1,2,3,70});
try {Thread.sleep(3000);}catch (Exception e) { }
os.write(new byte[]{1,2,3,70});
try {Thread.sleep(3000);}catch (Exception e) { }
os.write(new byte[]{1,2,3,70});
try {Thread.sleep(3000);}catch (Exception e) { }
os.write(new byte[]{1,2,3,70});
try {Thread.sleep(3000);}catch (Exception e) { }
try{ os.close(); }catch(Exception e){}
}catch(Exception e){
System.out.println(e.toString());
}
}
class Ambiente {
ServerSocket serverSocket=null;
private Ambiente(String host0,int port0) throws Exception {
// exemplo host0 -> "192.168.0.100"
if ( host0 == null || host0.equals("localhost") ){
try{
host0=InetAddress.getLocalHost().getHostName();
}catch(Exception e){
System.out.println("warning: procurando ip ...");
host0=getListaIPs().get(0);
System.out.println("warning: ip localizado -> "+host0);
}
}
serverSocket = new ServerSocket(port0, 1,InetAddress.getByName(host0));
}
private Socket getCredencialSocket() throws Exception {
return serverSocket.accept();
}
}
public static ArrayList<String> getListaIPs()
{
ArrayList<String> lista=new ArrayList<String>();
ArrayList<String> lista2=new ArrayList<String>();
try {
java.util.Enumeration<java.net.NetworkInterface> interfaces = java.net.NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
java.net.NetworkInterface iface = interfaces.nextElement();
if (iface.isLoopback() || !iface.isUp())
continue;
java.util.Enumeration<InetAddress> addresses = iface.getInetAddresses();
while(addresses.hasMoreElements()) {
InetAddress addr = addresses.nextElement();
if ( addr.getHostAddress().startsWith("192.168.0.") || addr.getHostAddress().startsWith("192.168.1.") )
lista.add(addr.getHostAddress());
else
lista2.add(addr.getHostAddress());
}
}
} catch (java.net.SocketException e) {
throw new RuntimeException(e);
}
lista.addAll(lista2);
return lista;
}
public String padLeftZeros(String inputString, int length) {
if (inputString.length() >= length) {
return inputString;
}
StringBuilder sb = new StringBuilder();
while (sb.length() < length - inputString.length()) {
sb.append('0');
}
sb.append(inputString);
return sb.toString();
}
}
class XML{
public static String linhasExcel="0123456789";
public static int linhasExcel_len=linhasExcel.length();
public static String colunasExcel="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static int colunasExcel_len=colunasExcel.length();
public static String sepCSV=";";
private static void resetControleTags(){
controleTags_pilha=new ArrayList<String>();
controleTags_tags=new ArrayList<String>();
controleTags_nivelTail=-1;
pivo_t=null;
pivo_r=null;
pivo_txt=null;
}
private static ArrayList<String> controleTags_pilha=new ArrayList<String>();
private static ArrayList<String> controleTags_tags=new ArrayList<String>();
private static int controleTags_nivelTail=-1;
private static String pivo_t=null;
private static String pivo_r=null;
private static String pivo_s=null;
private static String pivo_txt=null;
public static ArrayList<String> shared=null;
private static void controleTags(String txt,int nivel,boolean exportSheetCSV){
nivel=nivel-1;// lista iniciada com 0
pivo_txt=null;
if ( nivel == controleTags_nivelTail+1 ){
if ( ! txt.trim().startsWith("<") ){
// pivo_txt
if ( exportSheetCSV
&& controleTags_pilha.size() == 5
&& controleTags_pilha.get(0).equals("worksheet")
&& controleTags_pilha.get(1).equals("sheetData")
&& controleTags_pilha.get(2).equals("row")
&& controleTags_pilha.get(3).equals("c")
&& controleTags_pilha.get(4).equals("v")
){
pivo_txt=txt;
}
return;
}
if ( txt.trim().startsWith("</") ){
ErroFatal(54);
}
controleTags_pilha.add(getTagFromLine(txt));
controleTags_nivelTail=nivel;
controleTagsUpdate();
// pivo_t/pivo_r/pivo_r
if ( exportSheetCSV
&& controleTags_pilha.size() == 4
&& controleTags_pilha.get(0).equals("worksheet")
&& controleTags_pilha.get(1).equals("sheetData")
&& controleTags_pilha.get(2).equals("row")
&& controleTags_pilha.get(3).equals("c")
){
pivo_t=null;
pivo_r=null;
pivo_s=null;
HashMap att=getAtributosFromLine(txt);
if (att.containsKey("t"))
pivo_t=att.get("t").toString();
if (att.containsKey("r"))
pivo_r=att.get("r").toString();
if (att.containsKey("s"))
pivo_s=att.get("s").toString();
}
return;
}
if ( nivel == controleTags_nivelTail ){
if ( ! txt.trim().startsWith("<") ) return;
if ( txt.trim().startsWith("</") ) return;
// remove a ultima posicao
controleTags_pilha.remove(controleTags_pilha.size()-1);
controleTags_pilha.add(getTagFromLine(txt));
controleTags_nivelTail=nivel;
controleTagsUpdate();
// pivo_t/pivo_r/pivo_s
if ( exportSheetCSV
&& controleTags_pilha.size() == 4
&& controleTags_pilha.get(0).equals("worksheet")
&& controleTags_pilha.get(1).equals("sheetData")
&& controleTags_pilha.get(2).equals("row")
&& controleTags_pilha.get(3).equals("c")
){
pivo_t=null;
pivo_r=null;
pivo_s=null;
HashMap att=getAtributosFromLine(txt);
if (att.containsKey("t"))
pivo_t=att.get("t").toString();
if (att.containsKey("r"))
pivo_r=att.get("r").toString();
if (att.containsKey("s"))
pivo_s=att.get("s").toString();
}
return;
}
if ( nivel == controleTags_nivelTail-1 ){
if ( ! txt.trim().startsWith("<") )
return;
if ( txt.trim().startsWith("</") ){
controleTags_pilha.remove(controleTags_pilha.size()-1);
controleTags_nivelTail=nivel;
return;
}
// remove as duas ultimas posicoes
controleTags_pilha.remove(controleTags_pilha.size()-1);
controleTags_pilha.remove(controleTags_pilha.size()-1);
controleTags_pilha.add(getTagFromLine(txt));
controleTags_nivelTail=nivel;
controleTagsUpdate();
return;
}
}
private static void controleTagsUpdate(){
String tag="";
for ( int j=0;j<controleTags_pilha.size();j++ )
tag+="/"+controleTags_pilha.get(j);
boolean achou=false;
for ( int j=0;j<controleTags_tags.size();j++ ){
if ( controleTags_tags.get(j).equals(tag) ){
achou=true;
break;
}
}
if ( ! achou )
controleTags_tags.add(tag);
}
// faz arredondamento e tira notação cientifica
// de 5.8000000000000003E-2
// para 0.058
// de 0.99409999999999998
// para 0.9941
private static String arredondamentoNumber(String txt) {
boolean analise=false;
if ( txt.equals("6.7100000000000007E-2") ) // 0.060
analise=true;
int flutuacao=0;
String tmp="";
String a="";
String b="";
boolean achou=false;
if ( txt.contains("E") ){
tmp=txt.split("E")[1];
txt=txt.split("E")[0];
flutuacao=Integer.parseInt(tmp);
}
a=txt.split("\\.")[0];
b=txt.split("\\.")[1];
if ( b.length() >= 15 ){
// arredondamento ...999X
// de 0.99409999999999998
// para 0.9941
if (
b.substring(b.length()-2,b.length()-1).equals("9")
&& b.substring(b.length()-3,b.length()-2).equals("9")
&& b.substring(b.length()-4,b.length()-3).equals("9")
){
for( int i=b.length()-5;i>=0;i-- ){
if ( ! b.substring(i,i+1).equals("9") ){
b=b.substring(0,i)+(Integer.parseInt(b.substring(i,i+1))+1);
achou=true;
break;
}
}
if ( ! achou ){
b="0";
a=(Integer.parseInt(a)+1)+"";
}
}else{
// convert 058000000000000003 em 058
if (
b.substring(b.length()-2,b.length()-1).equals("0")
&& b.substring(b.length()-3,b.length()-2).equals("0")
&& b.substring(b.length()-4,b.length()-3).equals("0")
){
for( int i=b.length()-5;i>=0;i-- ){
if ( ! b.substring(i,i+1).equals("0") ){
b=b.substring(0,i)+b.substring(i,i+1);
achou=true;
break;
}
}
}
if ( ! achou ){
b="0";
}
}
}
while(flutuacao>0){
if ( b.length() == 0 ){
a+="0";
}else{
a+=b.substring(0,1);
b=b.substring(1);
}
flutuacao--;
}
while(flutuacao<0){
b=a+b;
a="0";
flutuacao++;
}
if ( b.equals("0") )
return a;
return a+"."+b;
}
private HashMap atributos=new HashMap();
private String value=null;
private ArrayList<XML> filhos=new ArrayList<XML>();
private String tag=null;
public static ArrayList<String> listaTxt=null;
public static ArrayList<Integer> listaNivel=null;
public static void loadIs(InputStream is,boolean mostraEstrutura,boolean mostraTags,String caminho, boolean exportSheetCSV,OutputStream out, boolean suprimeHeader) throws Exception {
resetLista();
Y.readLine(is,"UTF-8",">");
StringBuilder sb=new StringBuilder();
String txt=null;
boolean first=true;
String entrada=null;
String tail=null;
sb=new StringBuilder();
int len=0;
int nivel=1;
boolean tag_in=false;
boolean tag_finish=false;
boolean tag_value=false;
boolean tail_tag_abertura=false; //
if ( exportSheetCSV )
processaCelulaInit();
if ( mostraEstrutura && caminho != null )
System.out.println("\n=> "+caminho);
resetControleTags();
while ( (txt=Y.readLine()) != null ){
txt=txt.replace("\n","")+">";
len=txt.length();
if ( first ){
first=false;
int detectBOM=txt.indexOf("<?xml");
if ( detectBOM > -1 && detectBOM <= 3 )
continue;
}
for( int i=0;i<len;i++ ){
entrada=txt.substring(i,i+1);
if ( nivel < 1 ){
ErroFatal(1);
}
if ( tag_in && tag_value ){
ErroFatal(2);
}
if ( tail == null ){
tail=entrada;
continue;
}
if( !tag_in && !tag_value && tail.equals("<") && entrada.equals("/") ){ // tag de fechamento
sb.append(tail);
sb.append(entrada);
tail=null;
tag_in=true;
tag_finish=true;
nivel--;
continue;
}
if( !tag_in && !tag_value && tail.equals("<") ){ // tag de abertura ou tag unica
sb.append(tail);
tail=entrada;
tag_in=true;
continue;
}
if ( tag_in && tail.equals("/") && entrada.equals(">") ){ // tag unica
if ( tag_finish ){ // nao pode haver finish com tag unica
ErroFatal(3);
}
sb.append(tail);
sb.append(entrada);
tail=null;
tag_in=false;
tag_finish=false; // segurança
addLista(sb.toString(),nivel,mostraEstrutura,exportSheetCSV,out,suprimeHeader);
sb=new StringBuilder();
tail_tag_abertura=false;
continue;
}
if ( tag_in && entrada.equals(">") ){ // tag abertura ou tag fechamento
sb.append(tail);
sb.append(entrada);
tail=null;
tag_in=false;
addLista(sb.toString(),nivel,mostraEstrutura,exportSheetCSV,out,suprimeHeader);
sb=new StringBuilder();
if ( tag_finish ){
//nivel--; foi decrementado em outro local
tail_tag_abertura=false;
}else{
nivel++;
tail_tag_abertura=true;
}
tag_finish=false;
continue;
}
if ( !tag_in && !tag_value && entrada.equals("<") ){ // inicio e fim de value bem rapido ex: ...>5<...
if ( ! tail_tag_abertura ){
// nao eh possivel iniciar value
tail=entrada;
continue;
}
tag_value=true;
sb.append(tail);
tail=entrada;
addLista(sb.toString(),nivel,mostraEstrutura,exportSheetCSV,out,suprimeHeader);
sb=new StringBuilder();
tag_value=false;
tail_tag_abertura=false;
continue;
}
if ( !tag_in && !tag_value ){ // iniciando value
if ( ! tail_tag_abertura ){
// nao eh possivel iniciar value
tail=entrada;
continue;
}
tag_value=true;
sb.append(tail);
tail=entrada;
continue;
}
if( tag_value && entrada.equals("<") ){ // finalizando processamento de value
tag_value=false;
sb.append(tail);
tail=entrada;
addLista(sb.toString(),nivel,mostraEstrutura,exportSheetCSV,out,suprimeHeader);
sb=new StringBuilder();
continue;
}
sb.append(tail);
tail=entrada;
continue;
}
}
Y.closeLine();
if ( exportSheetCSV )
processaCelulaFlush(out);
if ( tail != null ){
ErroFatal(4);
}
if ( mostraTags )
for (int i=0;i<controleTags_tags.size();i++ )
System.out.println(controleTags_tags.get(i));
}
private static void resetLista() {
listaTxt=new ArrayList<String>();
listaNivel=new ArrayList<Integer>();
}
private static void addLista(String txt, int nivel, boolean mostraEstrutura, boolean exportSheetCSV,OutputStream out, boolean suprimeHeader) throws Exception{
if ( mostraEstrutura ){
if ( ! txt.trim().equals("") ){
for (int j=0;j<nivel-1;j++ )
System.out.print("\t");
System.out.println(txt);
}
}
controleTags(txt.trim(),nivel,exportSheetCSV);
if ( exportSheetCSV ){
if ( pivo_txt != null ){
if ( pivo_t != null && pivo_t.equals("s") ){
processaCelula(
pivo_r
,shared.get(Integer.parseInt(pivo_txt))
,out
,suprimeHeader
);
}else{
if ( pivo_s != null && pivo_s.equals("2") && ( pivo_txt.contains("E") || ( txt.contains(".") && txt.split("\\.")[1].length() >= 15 ) ) ){
processaCelula(
pivo_r
,arredondamentoNumber(pivo_txt)
,out
,suprimeHeader
);
}else{
processaCelula(
pivo_r
,pivo_txt
,out
,suprimeHeader
);
}
}
}
}else{
// processamento cache
listaTxt.add(txt.trim());
listaNivel.add(nivel);
}
}
private static StringBuilder processaCelula_sb=new StringBuilder();
private static int processaCelula_tail_linha=-1;
private static int processaCelula_tail_coluna=-1;
private static int processaCelula_max_tail_coluna=-1;
private static int countWrited=0;
private static void processaCelulaInit(){
processaCelula_sb=new StringBuilder();
processaCelula_tail_linha=-1;
processaCelula_tail_coluna=-1;
processaCelula_max_tail_coluna=-1;
countWrited=0;
}
private static void processaCelula(String localCelula, String valor, OutputStream out, boolean suprimeHeader) throws Exception {
//public static String linhasExcel="0123456789";
//public static String colunasExcel="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int linha=0;
int linha_exp=0;
int coluna=0;
int coluna_exp=0;
int len=localCelula.length();
String entrada="";
int pos=0;
if ( valor == null )
valor="";
valor=valor.replace("<","<").replace(">",">").replace("&","&").replace("\"","\"\"");
for ( int i=len-1;i>=0;i-- ){ // obs: no excel a primeira linha é 1. A primeira coluna é A(aqui representada com 0)
entrada=localCelula.substring(i,i+1);
pos=linhasExcel.indexOf(entrada);
if ( pos != -1 ){ // linha
linha+=Math.pow(linhasExcel_len, linha_exp++)*pos;
}else{ // coluna
pos=colunasExcel.indexOf(entrada);
if ( pos != -1 ){
coluna+=Math.pow(colunasExcel_len, coluna_exp++)*pos;
}else{
XML.ErroFatal(15);
}
}
}
if ( processaCelula_tail_linha == -1 ){
processaCelula_tail_linha=linha;
processaCelula_tail_coluna=-1;
if ( processaCelula_tail_coluna > processaCelula_max_tail_coluna )
processaCelula_max_tail_coluna=coluna;
}else{
if ( processaCelula_tail_linha > linha ){
XML.ErroFatal(14);
}
while(processaCelula_tail_linha < linha){
while(processaCelula_tail_coluna<processaCelula_max_tail_coluna){
processaCelula_sb.append("\"\"");
processaCelula_sb.append(sepCSV);
processaCelula_tail_coluna++;
}
processaCelula_tail_coluna=-1;
countWrited++;
if ( suprimeHeader && countWrited == 1 ){
// suprime
}else{
out.write(processaCelula_sb.toString().getBytes());
out.write("\n".getBytes());
}
processaCelula_sb=new StringBuilder();
processaCelula_tail_linha++;
}
}
while(processaCelula_tail_coluna<coluna-1){
processaCelula_sb.append("\"\"");
processaCelula_sb.append(sepCSV);
processaCelula_tail_coluna++;
}
processaCelula_sb.append("\"");
processaCelula_sb.append(valor);
processaCelula_sb.append("\"");
processaCelula_sb.append(sepCSV);
processaCelula_tail_linha=linha;
processaCelula_tail_coluna=coluna;
if ( processaCelula_tail_coluna > processaCelula_max_tail_coluna ){
processaCelula_max_tail_coluna=coluna;
}
}
private static void processaCelulaFlush(OutputStream out) throws Exception{
if ( processaCelula_sb.length() > 0 ){
while(processaCelula_tail_coluna<processaCelula_max_tail_coluna){
processaCelula_sb.append("\"\"");
processaCelula_sb.append(sepCSV);
processaCelula_tail_coluna++;
}
out.write(processaCelula_sb.toString().getBytes());
out.write("\n".getBytes());
}
}
public static XML getXML(){
return ((ArrayList<XML>)getXML(1,0,listaTxt.size()-1)).get(0);
}
public static Object getXML(int nivel,int ini,int fim){
// retorno pode ser ArrayList<XML> ou String
// nivel inicia em 1
// int inicia em 0
String tag="";
String tipoTag=""; // inicio fim unica
if ( ini == fim && !listaTxt.get(ini).startsWith("<") )
return listaTxt.get(ini);
ArrayList<XML> lista=new ArrayList<XML>();
XML xml=null;
int inicio_n=0;
String inicio_tag="";
for(int i=ini;i<=fim;i++ ){
if ( listaNivel.get(i) == nivel && xml == null ){
if ( listaTxt.get(i).trim().equals("") )
continue;
xml=new XML();
tag=XML.getTagFromLine(listaTxt.get(i));
tipoTag=XML.getTipoTagFromLine(listaTxt.get(i));
if ( tipoTag.equals("fim") )
ErroFatal(8);
xml.addAtributoAll(XML.getAtributosFromLine(listaTxt.get(i)));
if ( tipoTag.equals("unica") ){
xml.setTag(tag);
lista.add(xml);
xml=null;
}else{
inicio_n=i;
inicio_tag=tag;
xml.setTag(tag);
}
continue;
}
if ( listaNivel.get(i) == nivel && xml != null ){
tag=XML.getTagFromLine(listaTxt.get(i));
tipoTag=XML.getTipoTagFromLine(listaTxt.get(i));
if ( !tipoTag.equals("fim") )
ErroFatal(9);
if ( ! tag.equals(inicio_tag) )
ErroFatal(10);
if ( (i-inicio_n) > 1 ){
Object interno=getXML(nivel+1,inicio_n+1,i-1);
try{
xml.addFilhos((ArrayList<XML>)interno);
}catch(Exception e){
xml.value=(String)interno;
}
}
lista.add(xml);
xml=null;
}
}
return lista;
}
private static String getTagFromLine(String line) {
String tag=line.replace("<","").replace(">","").replace("/","").split(" ")[0];
if ( tag.length() == 0 )
ErroFatal(12);
return tag;
}
private static String getTipoTagFromLine(String line) {
String tipoTag=null;
if ( line.startsWith("</") )
tipoTag="fim";
else{
if ( line.endsWith("/>") )
tipoTag="unica";
else{
if ( !line.startsWith("<") || !line.endsWith(">") )
ErroFatal(11);
tipoTag="inicio";
}
}
return tipoTag;
}
private static HashMap getAtributosFromLine(String a) {
ArrayList<String> partes=new ArrayList<String>();
a=a.replace("<","").replace(">","").replace("/","");
int len=a.length();
boolean aspas_in=false;
String entrada="";
StringBuilder sb=new StringBuilder();
HashMap retorno=new HashMap();
for ( int i=0;i<len;i++ ){
entrada=a.substring(i,i+1);
if(entrada.equals("\""))
aspas_in=!aspas_in;
if ( !aspas_in && entrada.equals(" ") ){
partes.add(sb.toString());
sb=new StringBuilder();
continue;
}
sb.append(entrada);
}
if ( sb.toString().length() > 0 )
partes.add(sb.toString());
String k="";
String v="";
for(int i=1;i<partes.size();i++){
try{
k=partes.get(i).split("=")[0];
v=partes.get(i).split("=")[1].replace("\"","");
if ( k.length() > 0 && v.length() > 0 ){
retorno.put(k, v);
}
}catch(Exception e){}
}
return retorno;
}
public void setTag(String tag){
this.tag=tag;
}
public String getTag(){
return tag;
}
public String getAtributo(String a){
return (String)atributos.get(a);
}
public void addAtributoAll(HashMap a) {
atributos.putAll(a);
}
public List<String> getAtributosNames() {
return new ArrayList<String>(atributos.keySet());
}
public void setValue(String value){
this.value=value;
}
public String getValue(){
return value;
}
public void addFilhos(ArrayList<XML> a) {
filhos.addAll(a);
}
public ArrayList<XML> getFilhos(){
return filhos;
}
public static void ErroFatal(int n) {
System.out.println("Erro Fatal! "+n);
System.err.println("Erro Fatal! "+n);
System.exit(1);
}
}
/* class AES */ // echo TXT | openssl aes-256-cbc -base64 -pass pass:SENHA -md md5 -e
/* class AES */ // y echo PPP | openssl aes-256-cbc -md md5 -k SENHA -e | y base64
/* class AES */ // ===> ATENCAO, só é compativel com o openssl com o parametro -md md5
/* class AES */ // creditos: https://github.com/chmduquesne/minibackup/blob/master/samples/OpensslAES.java
/* class AES */ // new AES().encrypt(bytes,password);
/* class AES */ // new AES().decrypt(bytes,password);
/* class AES */ class AES{ byte [] deriveKeyAndIV(byte[] password, String md, byte[] salt) throws Exception{ if ( md == null || md.equals("") ) md="MD5"; byte[] res = new byte[48]; final java.security.MessageDigest md5 = java.security.MessageDigest.getInstance(md); md5.update(password); md5.update(salt); byte[] hash1 = md5.digest(); md5.reset(); md5.update(hash1); md5.update(password); md5.update(salt); byte[] hash2 = md5.digest(); md5.reset(); md5.update(hash2); md5.update(password); md5.update(salt); byte[] hash3 = md5.digest(); if ( md == null || md.equals("MD5")){ System.arraycopy(hash1, 0, res, 0, 16); System.arraycopy(hash2, 0, res, 16, 16); System.arraycopy(hash3, 0, res, 32, 16); }else{ System.arraycopy(hash1, 0, res, 0, 32); System.arraycopy(hash2, 0, res, 32, 16); } return res; } public void encrypt(java.io.InputStream pipe_in, java.io.OutputStream pipe_out, String senha, String md, byte[] salt) throws Exception { byte[] salt_ = new byte[8]; java.security.SecureRandom sr = new java.security.SecureRandom(); sr.nextBytes(salt_); if ( salt==null ) salt=salt_; byte[] keyAndIV = deriveKeyAndIV(senha.getBytes(),md,salt); byte[] key = java.util.Arrays.copyOfRange(keyAndIV, 0, 32); byte[] iv = java.util.Arrays.copyOfRange(keyAndIV, 32, 48); javax.crypto.spec.SecretKeySpec skeySpec = new javax.crypto.spec.SecretKeySpec(key, "AES"); javax.crypto.spec.IvParameterSpec ivspec = new javax.crypto.spec.IvParameterSpec(iv); javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, skeySpec, ivspec); int BUFFER_SIZE=1024; byte[] buff=new byte[BUFFER_SIZE]; int len=0; pipe_out.write("Salted__".getBytes()); pipe_out.write(salt); while ( (len=pipe_in.read(buff,0,BUFFER_SIZE)) > 0 ) pipe_out.write( cipher.update(buff,0,len) ); pipe_out.write(cipher.doFinal()); pipe_out.flush(); } public byte[] encrypt(byte[] data, String senha, String md, byte[] salt) throws Exception{ java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(data); java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); encrypt(bais,baos,senha,md,salt); return baos.toByteArray(); } public void decrypt(java.io.InputStream pipe_in,java.io.OutputStream pipe_out,String senha,String md) throws Exception { int p=0; p=pipe_in.read(new byte[8]); if ( p != 8 ){ System.err.println("Erro fatal 0!"); System.exit(1); } byte[] salt=new byte[8]; p=pipe_in.read(salt); if ( p != 8 ){ System.err.println("Erro fatal 0!"); System.exit(1); } byte[] keyAndIV=deriveKeyAndIV(senha.getBytes(),md,salt); byte[] key=java.util.Arrays.copyOfRange(keyAndIV, 0, 32); byte[] iv=java.util.Arrays.copyOfRange(keyAndIV, 32, 48); javax.crypto.spec.SecretKeySpec skeySpec = new javax.crypto.spec.SecretKeySpec(key, "AES"); javax.crypto.spec.IvParameterSpec ivspec = new javax.crypto.spec.IvParameterSpec(iv); javax.crypto.Cipher cipher; cipher=javax.crypto.Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(javax.crypto.Cipher.DECRYPT_MODE, skeySpec, ivspec); int BUFFER_SIZE=1024; byte[] buff=new byte[BUFFER_SIZE]; int len=0; while ( (len=pipe_in.read(buff,0,BUFFER_SIZE)) > 0 ) pipe_out.write( cipher.update(buff,0,len) ); pipe_out.write(cipher.doFinal()); pipe_out.flush(); } public byte[] decrypt(byte[] data, String senha, String md) throws Exception{ java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(data); java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); decrypt(bais,baos,senha,md); return baos.toByteArray(); } private static String bytesToHex(byte[] a){ StringBuilder sb = new StringBuilder(); for (byte b : a) { sb.append(String.format("%02X", b)); } return sb.toString(); } private static byte[] hexTobytes(String s) { int len = s.length(); byte[] data = new byte[len / 2]; for (int i = 0; i < len; i += 2) { data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i+1), 16)); } return data;}}
/* class Utilonsole */ // String senha=Utilonsole.getPasswordConsole("Digite a senha: ");
/* class Utilonsole */ // String texto=Utilonsole.getTextConsole("Digite o texto: ");
/* class Utilonsole */ class Utilonsole{ public static String getPasswordConsole(String txt) { String retorno=""; java.io.Console console=System.console(); if ( console == null ){ System.out.println("Error, input nao suportado nesse ambiente, rodando no netbeans?..."); System.exit(1); } char [] passChar = System.console().readPassword(txt); if ( passChar != null ) retorno=new String(passChar); if ( retorno == null ){ System.out.println("Error, not input found"); System.exit(1); } return retorno;}public static String getTextConsole(String txt) { String retorno=""; java.io.Console console=System.console(); if ( console == null ){ System.out.println("Error, input nao suportado nesse ambiente, rodando no netbeans?..."); System.exit(1); } System.out.print(txt);retorno=System.console().readLine();if ( retorno == null ){ System.out.println("Error, not input found"); System.exit(1); } return retorno;}}
/* class JSchCustom */ class JSchCustom { void scpFrom(String[] args, String senha, int port) { ScpFrom.custom(args, senha, port); } void scpTo(String[] args, String senha, int port) { ScpTo.custom(args, senha, port); } void execSsh(String[] args, String senha, int port) { ExecSsh.custom(args, senha, port); } void ssh(String[] args, String senha, int port) { Ssh.custom(args, senha, port); } void sftp(String[] args, String senha, int port) { Sftp.custom(args, senha, port); } } class ScpFrom { public static void custom(String[] arg, String senha, int port) { if (arg.length != 2 || !arg[0].contains("@")) { System.err.println("usage: y scp user,pass@remotehost:file1 file2"); System.exit(-1); } FileOutputStream fos = null; try { String user = arg[0].substring(0, arg[0].indexOf('@')); arg[0] = arg[0].substring(arg[0].indexOf('@') + 1); String host = arg[0].substring(0, arg[0].indexOf(':')); String rfile = arg[0].substring(arg[0].indexOf(':') + 1); String lfile = arg[1]; String prefix = null; if (new File(lfile).isDirectory()) { prefix = lfile + File.separator; } JSch jsch = new JSch(); Session session = jsch.getSession(user, host, port); UserInfo ui = new MyUserInfo(senha); session.setUserInfo(ui); session.connect(); String command = "scp -f " + rfile; Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); OutputStream out = channel.getOutputStream(); InputStream in = channel.getInputStream(); channel.connect(); byte[] buf = new byte[1024]; buf[0] = 0; out.write(buf, 0, 1); out.flush(); while (true) { int c = checkAck( in ); if (c != 'C') { break; } in.read(buf, 0, 5); long filesize = 0L; while (true) { if ( in .read(buf, 0, 1) < 0) { break; } if (buf[0] == ' ') break; filesize = filesize * 10L + (long)(buf[0] - '0'); } String file = null; for (int i = 0;; i++) { in .read(buf, i, 1); if (buf[i] == (byte) 0x0a) { file = new String(buf, 0, i); break; } } buf[0] = 0; out.write(buf, 0, 1); out.flush(); fos = new FileOutputStream(prefix == null ? lfile : prefix + file); int foo; while (true) { if (buf.length < filesize) foo = buf.length; else foo = (int) filesize; foo = in .read(buf, 0, foo); if (foo < 0) { break; } fos.write(buf, 0, foo); filesize -= foo; if (filesize == 0L) break; } fos.close(); fos = null; if (checkAck( in ) != 0) { System.exit(0); } buf[0] = 0; out.write(buf, 0, 1); out.flush(); } session.disconnect(); System.exit(0); } catch (Exception e) { System.out.println(e); try { if (fos != null) fos.close(); } catch (Exception ee) {} } } static int checkAck(InputStream in ) throws IOException { int b = in .read(); if (b == 0) return b; if (b == -1) return b; if (b == 1 || b == 2) { StringBuffer sb = new StringBuffer(); int c; do { c = in .read(); sb.append((char) c); } while (c != '\n'); if (b == 1) { System.out.print(sb.toString()); } if (b == 2) { System.out.print(sb.toString()); } } return b; } public static class MyUserInfo implements UserInfo, UIKeyboardInteractive { String passwd; String senha; private MyUserInfo(String senha) { this.senha = senha; } public String getPassword() { return passwd; } public boolean promptYesNo(String str) { return true; } JTextField passwordField = (JTextField) new JPasswordField(20); public String getPassphrase() { return null; } public boolean promptPassphrase(String message) { return true; } public boolean promptPassword(String message) { passwd = senha; return true; } public void showMessage(String message) { System.err.println("nao implementado! cod 1"); System.exit(1); }
/* class JSchCustom */ final GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0); private Container panel; public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { return null; } } } class ScpTo { public static void custom(String[] arg, String senha, int port) { if (arg.length != 2 || !arg[1].contains("@")) { System.err.println("usage: y scp file1 user,pass@remotehost:file2"); System.exit(-1); } FileInputStream fis = null; try { String lfile = arg[0]; String user = arg[1].substring(0, arg[1].indexOf('@')); arg[1] = arg[1].substring(arg[1].indexOf('@') + 1); String host = arg[1].substring(0, arg[1].indexOf(':')); String rfile = arg[1].substring(arg[1].indexOf(':') + 1); JSch jsch = new JSch(); Session session = jsch.getSession(user, host, 22); UserInfo ui = new MyUserInfo(senha); session.setUserInfo(ui); session.connect(); boolean ptimestamp = true; String command = "scp " + (ptimestamp ? "-p" : "") + " -t " + rfile; Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); OutputStream out = channel.getOutputStream(); InputStream in = channel.getInputStream(); channel.connect(); if (checkAck( in ) != 0) { System.exit(0); } File _lfile = new File(lfile); if (ptimestamp) { command = "T" + (_lfile.lastModified() / 1000) + " 0"; command += (" " + (_lfile.lastModified() / 1000) + " 0\n"); out.write(command.getBytes()); out.flush(); if (checkAck( in ) != 0) { System.exit(0); } } long filesize = _lfile.length(); command = "C0644 " + filesize + " "; if (lfile.lastIndexOf('/') > 0) { command += lfile.substring(lfile.lastIndexOf('/') + 1); } else { command += lfile; } command += "\n"; out.write(command.getBytes()); out.flush(); if (checkAck( in ) != 0) { System.exit(0); } fis = new FileInputStream(lfile); byte[] buf = new byte[1024]; while (true) { int len = fis.read(buf, 0, buf.length); if (len <= 0) break; out.write(buf, 0, len); } fis.close(); fis = null; buf[0] = 0; out.write(buf, 0, 1); out.flush(); if (checkAck( in ) != 0) { System.exit(0); } out.close(); channel.disconnect(); session.disconnect(); System.exit(0); } catch (Exception e) { System.out.println(e); try { if (fis != null) fis.close(); } catch (Exception ee) {} } } static int checkAck(InputStream in ) throws IOException { int b = in .read(); if (b == 0) return b; if (b == -1) return b; if (b == 1 || b == 2) { StringBuffer sb = new StringBuffer(); int c; do { c = in .read(); sb.append((char) c); } while (c != '\n'); if (b == 1) { System.out.print(sb.toString()); } if (b == 2) { System.out.print(sb.toString()); } } return b; } public static class MyUserInfo implements UserInfo, UIKeyboardInteractive { String passwd; String senha; private MyUserInfo(String senha) { this.senha = senha; } public String getPassword() { return passwd; } public boolean promptYesNo(String str) { return true; } JTextField passwordField = (JTextField) new JPasswordField(20); public String getPassphrase() { return null; } public boolean promptPassphrase(String message) { return true; } public boolean promptPassword(String message) { passwd = senha; return true; } public void showMessage(String message) { System.err.println("nao implementado! cod 3"); System.exit(1); } final GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
/* class JSchCustom */ private Container panel; public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { return null; } } } class ExecSsh { public static void custom(String[] arg, String senha, int port) { try { JSch jsch = new JSch(); if (arg.length != 2 || !arg[0].contains("@")) { System.err.println("usage: y execSsh user,pass@remotehost command"); System.exit(-1); } String user = arg[0].split("@")[0]; String host = arg[0].split("@")[1]; String command = arg[1]; Session session = jsch.getSession(user, host, port); UserInfo ui = new MyUserInfo(senha); session.setUserInfo(ui); session.connect(); Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); channel.setInputStream(null); ((ChannelExec) channel).setErrStream(System.err); InputStream in = channel.getInputStream(); channel.connect(); byte[] tmp = new byte[1024]; while (true) { while ( in .available() > 0) { int i = in .read(tmp, 0, 1024); if (i < 0) break; System.out.print(new String(tmp, 0, i)); } if (channel.isClosed()) { if ( in .available() > 0) continue; System.out.println("exit-status: " + channel.getExitStatus()); break; } try { Thread.sleep(1000); } catch (Exception ee) {} } channel.disconnect(); session.disconnect(); } catch (Exception e) { System.out.println(e); } } public static class MyUserInfo implements UserInfo, UIKeyboardInteractive { String passwd; String senha; private MyUserInfo(String senha) { this.senha = senha; } public String getPassword() { return passwd; } public boolean promptYesNo(String str) { return true; } JTextField passwordField = (JTextField) new JPasswordField(20); public String getPassphrase() { return null; } public boolean promptPassphrase(String message) { return true; } public boolean promptPassword(String message) { passwd = senha; return true; } public void showMessage(String message) { System.err.println("nao implementado! cod 5"); System.exit(1); } final GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0); private Container panel; public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { return null; } } } class Ssh { public static void custom(String[] arg, String senha, int port) { Channel channel = null; try { JSch jsch = new JSch(); if (arg.length != 1 || !arg[0].contains("@")) { System.err.println("usage: y ssh user,pass@remotehost"); System.exit(-1); } String user = arg[0].split("@")[0]; String host = arg[0].split("@")[1]; Session session = jsch.getSession(user, host, port); session.setPassword(senha); UserInfo ui = new MyUserInfo() { public void showMessage(String message) { JOptionPane.showMessageDialog(null, message); } public boolean promptYesNo(String message) { return true; } }; session.setUserInfo(ui); session.connect(30000); channel = session.openChannel("shell"); channel.setInputStream(System.in); channel.setOutputStream(System.out); channel.connect(3 * 1000); } catch (Exception e) { System.out.println(e); } while (channel != null && !channel.isEOF()) {} } public static abstract class MyUserInfo implements UserInfo, UIKeyboardInteractive { public String getPassword() { return null; } public boolean promptYesNo(String str) { return false; } public String getPassphrase() { return null; } public boolean promptPassphrase(String message) { return false; }
/* class JSchCustom */ public boolean promptPassword(String message) { return false; } public void showMessage(String message) {} public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { return null; } } } class Sftp { public static void custom(String[] arg, String senha, int port) { try { JSch jsch = new JSch(); if (arg.length != 1 || !arg[0].contains("@")) { System.err.println("usage: y sftp user,pass@remotehost"); System.err.println("usage: y sftp user,pass@remotehost 22"); System.exit(-1); } String user = arg[0].split("@")[0]; String host = arg[0].split("@")[1]; Session session = jsch.getSession(user, host, port); UserInfo ui = new MyUserInfo(senha); session.setUserInfo(ui); session.connect(); Channel channel = session.openChannel("sftp"); channel.connect(); ChannelSftp c = (ChannelSftp) channel; java.io.InputStream in = System.in; java.io.PrintStream out = System.out; java.util.Vector cmds = new java.util.Vector(); byte[] buf = new byte[1024]; int i; String str; int level = 0; while (true) { out.print("sftp> "); cmds.removeAllElements(); i = in .read(buf, 0, 1024); if (i <= 0) break; i--; if (i > 0 && buf[i - 1] == 0x0d) i--; int s = 0; for (int ii = 0; ii < i; ii++) { if (buf[ii] == ' ') { if (ii - s > 0) { cmds.addElement(new String(buf, s, ii - s)); } while (ii < i) { if (buf[ii] != ' ') break; ii++; } s = ii; } } if (s < i) { cmds.addElement(new String(buf, s, i - s)); } if (cmds.size() == 0) continue; String cmd = (String) cmds.elementAt(0); if (cmd.equals("quit")) { c.quit(); break; } if (cmd.equals("exit")) { c.exit(); break; } if (cmd.equals("rekey")) { session.rekey(); continue; } if (cmd.equals("compression")) { if (cmds.size() < 2) { out.println("compression level: " + level); continue; } try { level = Integer.parseInt((String) cmds.elementAt(1)); if (level == 0) { session.setConfig("compression.s2c", "none"); session.setConfig("compression.c2s", "none"); } else { session.setConfig("compression.s2c", "zlib@openssh.com,zlib,none"); session.setConfig("compression.c2s", "zlib@openssh.com,zlib,none"); } } catch (Exception e) {} session.rekey(); continue; } if (cmd.equals("cd") || cmd.equals("lcd")) { if (cmds.size() < 2) continue; String path = (String) cmds.elementAt(1); try { if (cmd.equals("cd")) c.cd(path); else c.lcd(path); } catch (SftpException e) { System.out.println(e.toString()); } continue; } if (cmd.equals("rm") || cmd.equals("rmdir") || cmd.equals("mkdir")) { if (cmds.size() < 2) continue; String path = (String) cmds.elementAt(1); try { if (cmd.equals("rm")) c.rm(path); else if (cmd.equals("rmdir")) c.rmdir(path); else c.mkdir(path); } catch (SftpException e) { System.out.println(e.toString()); } continue; } if (cmd.equals("chgrp") || cmd.equals("chown") || cmd.equals("chmod")) { if (cmds.size() != 3) continue; String path = (String) cmds.elementAt(2); int foo = 0; if (cmd.equals("chmod")) { byte[] bar = ((String) cmds.elementAt(1)).getBytes(); int k; for (int j = 0; j < bar.length; j++) { k = bar[j]; if (k < '0' || k > '7') { foo = -1; break; } foo <<= 3; foo |= (k - '0'); } if (foo == -1) continue; } else { try { foo = Integer.parseInt((String) cmds.elementAt(1)); } catch (Exception e) { continue; } } try { if (cmd.equals("chgrp")) { c.chgrp(foo, path); } else if (cmd.equals("chown")) { c.chown(foo, path); } else if (cmd.equals("chmod")) { c.chmod(foo, path); } } catch (SftpException e) { System.out.println(e.toString()); } continue; }
/* class JSchCustom */ if (cmd.equals("pwd") || cmd.equals("lpwd")) { str = (cmd.equals("pwd") ? "Remote" : "Local"); str += " working directory: "; if (cmd.equals("pwd")) str += c.pwd(); else str += c.lpwd(); out.println(str); continue; } if (cmd.equals("ls") || cmd.equals("dir")) { String path = "."; if (cmds.size() == 2) path = (String) cmds.elementAt(1); try { java.util.Vector vv = c.ls(path); if (vv != null) { for (int ii = 0; ii < vv.size(); ii++) { Object obj = vv.elementAt(ii); if (obj instanceof com.jcraft.jsch.ChannelSftp.LsEntry) { out.println(((com.jcraft.jsch.ChannelSftp.LsEntry) obj).getLongname()); } } } } catch (SftpException e) { System.out.println(e.toString()); } continue; } if (cmd.equals("lls") || cmd.equals("ldir")) { String path = "."; if (cmds.size() == 2) path = (String) cmds.elementAt(1); try { java.io.File file = new java.io.File(path); if (!file.exists()) { out.println(path + ": No such file or directory"); continue; } if (file.isDirectory()) { String[] list = file.list(); for (int ii = 0; ii < list.length; ii++) { out.println(list[ii]); } continue; } out.println(path); } catch (Exception e) { System.out.println(e); } continue; } if (cmd.equals("get") || cmd.equals("get-resume") || cmd.equals("get-append") || cmd.equals("put") || cmd.equals("put-resume") || cmd.equals("put-append")) { if (cmds.size() != 2 && cmds.size() != 3) continue; String p1 = (String) cmds.elementAt(1); String p2 = "."; if (cmds.size() == 3) p2 = (String) cmds.elementAt(2); try { SftpProgressMonitor monitor = new MyProgressMonitor(); if (cmd.startsWith("get")) { int mode = ChannelSftp.OVERWRITE; if (cmd.equals("get-resume")) { mode = ChannelSftp.RESUME; } else if (cmd.equals("get-append")) { mode = ChannelSftp.APPEND; } c.get(p1, p2, monitor, mode); } else { int mode = ChannelSftp.OVERWRITE; if (cmd.equals("put-resume")) { mode = ChannelSftp.RESUME; } else if (cmd.equals("put-append")) { mode = ChannelSftp.APPEND; } c.put(p1, p2, monitor, mode); } } catch (SftpException e) { System.out.println(e.toString()); } continue; } if (cmd.equals("ln") || cmd.equals("symlink") || cmd.equals("rename") || cmd.equals("hardlink")) { if (cmds.size() != 3) continue; String p1 = (String) cmds.elementAt(1); String p2 = (String) cmds.elementAt(2); try { if (cmd.equals("hardlink")) { c.hardlink(p1, p2); } else if (cmd.equals("rename")) c.rename(p1, p2); else c.symlink(p1, p2); } catch (SftpException e) { System.out.println(e.toString()); } continue; } if (cmd.equals("df")) { if (cmds.size() > 2) continue; String p1 = cmds.size() == 1 ? "." : (String) cmds.elementAt(1); SftpStatVFS stat = c.statVFS(p1); long size = stat.getSize(); long used = stat.getUsed(); long avail = stat.getAvailForNonRoot(); long root_avail = stat.getAvail(); long capacity = stat.getCapacity(); System.out.println("Size: " + size); System.out.println("Used: " + used); System.out.println("Avail: " + avail); System.out.println("(root): " + root_avail); System.out.println("%Capacity: " + capacity); continue; } if (cmd.equals("stat") || cmd.equals("lstat")) { if (cmds.size() != 2) continue; String p1 = (String) cmds.elementAt(1); SftpATTRS attrs = null; try { if (cmd.equals("stat")) attrs = c.stat(p1); else attrs = c.lstat(p1); } catch (SftpException e) { System.out.println(e.toString()); } if (attrs != null) { out.println(attrs); } else {} continue; } if (cmd.equals("readlink")) { if (cmds.size() != 2) continue; String p1 = (String) cmds.elementAt(1); String filename = null;
/* class JSchCustom */ try { filename = c.readlink(p1); out.println(filename); } catch (SftpException e) { System.out.println(e.toString()); } continue; } if (cmd.equals("realpath")) { if (cmds.size() != 2) continue; String p1 = (String) cmds.elementAt(1); String filename = null; try { filename = c.realpath(p1); out.println(filename); } catch (SftpException e) { System.out.println(e.toString()); } continue; } if (cmd.equals("version")) { out.println("SFTP protocol version " + c.version()); continue; } if (cmd.equals("help") || cmd.equals("?")) { out.println(help); continue; } out.println("unimplemented command: " + cmd); } session.disconnect(); } catch (Exception e) { System.out.println(e); } System.exit(0); } private static String help = " Available commands:\n" + " * means unimplemented command.\n" + "cd path Change remote directory to 'path'\n" + "lcd path Change local directory to 'path'\n" + "chgrp grp path Change group of file 'path' to 'grp'\n" + "chmod mode path Change permissions of file 'path' to 'mode'\n" + "chown own path Change owner of file 'path' to 'own'\n" + "df [path] Display statistics for current directory or\n" + " filesystem containing 'path'\n" + "help Display this help text\n" + "get remote-path [local-path] Download file\n" + "get-resume remote-path [local-path] Resume to download file.\n" + "get-append remote-path [local-path] Append remote file to local file\n" + "hardlink oldpath newpath Hardlink remote file\n" + "*lls [ls-options [path]] Display local directory listing\n" + "ln oldpath newpath Symlink remote file\n" + "*lmkdir path Create local directory\n" + "lpwd Print local working directory\n" + "ls [path] Display remote directory listing\n" + "*lumask umask Set local umask to 'umask'\n" + "mkdir path Create remote directory\n" + "put local-path [remote-path] Upload file\n" + "put-resume local-path [remote-path] Resume to upload file\n" + "put-append local-path [remote-path] Append local file to remote file.\n" + "pwd Display remote working directory\n" + "stat path Display info about path\n" + "exit Quit sftp\n" + "quit Quit sftp\n" + "rename oldpath newpath Rename remote file\n" + "rmdir path Remove remote directory\n" + "rm path Delete remote file\n" + "symlink oldpath newpath Symlink remote file\n" + "readlink path Check the target of a symbolic link\n" + "realpath path Canonicalize the path\n" + "rekey Key re-exchanging\n" + "compression level Packet compression will be enabled\n" + "version Show SFTP version\n" + "? Synonym for help"; public static class MyProgressMonitor implements SftpProgressMonitor { ProgressMonitor monitor; long count = 0; long max = 0; public void init(int op, String src, String dest, long max) { this.max = max; monitor = new ProgressMonitor(null, ((op == SftpProgressMonitor.PUT) ? "put" : "get") + ": " + src, "", 0, (int) max); count = 0; percent = -1; monitor.setProgress((int) this.count);
/* class JSchCustom */ monitor.setMillisToDecideToPopup(1000); } private long percent = -1; public boolean count(long count) { this.count += count; if (percent >= this.count * 100 / max) { return true; } percent = this.count * 100 / max; monitor.setNote("Completed " + this.count + "(" + percent + "%) out of " + max + "."); monitor.setProgress((int) this.count); return !(monitor.isCanceled()); } public void end() { monitor.close(); } } public static class MyUserInfo implements UserInfo, UIKeyboardInteractive { String passwd; String senha; private MyUserInfo(String senha) { this.senha = senha; } public String getPassword() { return passwd; } public boolean promptYesNo(String str) { return true; } JTextField passwordField = (JTextField) new JPasswordField(20); public String getPassphrase() { return null; } public boolean promptPassphrase(String message) { return true; } public boolean promptPassword(String message) { passwd = senha; return true; } public void showMessage(String message) { System.err.println("nao implementado! cod 7"); System.exit(1); } final GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0); private Container panel; public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { return null; } } }
/* class HttpServer */ // parametros
/* class HttpServer */ // new HttpServer(...)
/* class HttpServer */ // host(pode ser ""), titulo_url, titulo, port, dir, endsWiths(ex: "","jar,zip"), ips_banidos(ex: "","8.8.8.8,4.4.4.4")
/* class HttpServer */ class HttpServer {String host,titulo_url,titulo,dir,nav,endsWiths,ips_banidos;int port;Socket socket = null;public HttpServer(String[] args){ host=args[0]; if ( args[0] == null || args[0].equals("localhost") )try{host=InetAddress.getLocalHost().getHostName();}catch(Exception e){} titulo_url = args[1];titulo = args[2];port = Integer.parseInt(args[3]);dir = args[4].trim();if ( ! dir.endsWith("/") ) dir+="/";endsWiths = args[5];ips_banidos = args[6];try{serve();}catch(Exception e){System.err.println(e.toString());System.exit(1);}}public void serve() throws Exception {ServerSocket serverSocket = null;String origem="";try {serverSocket = new ServerSocket(port, 1,InetAddress.getByName(host));System.out.println("Service opened: http://"+host+":"+port+"/"+titulo_url);System.out.println("path work: "+dir);} catch (Exception e) {throw new Exception("erro na inicialização: "+e.toString());}while(true) {try {socket = serverSocket.accept();origem = socket.getRemoteSocketAddress().toString();if ( origem.length() > 2 && origem.startsWith("/") )origem=origem.substring(1);if ( origem.indexOf(":") != -1 )origem=origem.substring(0,origem.indexOf(":"));System.out.println("Conexao de origem: "+origem+", data:"+(new Date()));if ( ips_banidos.length() > 0 && (","+ips_banidos+",").contains(","+origem+",") ){System.out.println("Acesso recusado para o ip banido: "+origem);continue;}new ClientThread(socket,titulo_url,titulo,dir,endsWiths);} catch (Exception e) {System.out.println("Erro ao executar servidor:" + e.toString());}}}}class ClientThread {String method,uri,protocol,titulo_url,titulo,dir,endsWiths;String nav;InputStream input = null;OutputStream output = null;char[] buffer = new char[2048];Writer writer;InputStreamReader isr=null;Reader reader;public ClientThread(final Socket socket,String titulo_url, String titulo, String dir,String endsWiths) {this.titulo_url=titulo_url;this.titulo=titulo;this.dir=dir;this.endsWiths=endsWiths;new Thread(){public void run(){try {input = socket.getInputStream();output = socket.getOutputStream();if ( input != null ){isr = new InputStreamReader(input);reader = new BufferedReader(isr);writer = new StringWriter();lendo();gravando();socket.close();writer.close();reader.close();isr.close();}} catch (Exception e) {System.out.println("----------> Erro ao executar servidor:" + e.toString());}}}.start();}private void lendo() throws Exception {try {int i = reader.read(buffer);if ( i == -1 ) return;writer.write(buffer, 0, i);BufferedReader br = new BufferedReader(new StringReader(writer.toString()));String line = null;int lineNumber = 0;while ((line = br.readLine()) != null) {System.out.println("<---| " + line);if (lineNumber == 0 && line.split(" ").length == 3 ) {this.method = line.split(" ")[0];this.uri = line.split(" ")[1];this.protocol = line.split(" ")[2];}lineNumber++;}System.out.println(" | ");} catch (IOException e) {throw new Exception("Erro ao converter stream para string:" + e.toString());}}private void gravando() throws Exception {StringBuilder sb = new StringBuilder();if ( method.equals("OPTIONS") ){for ( String line : new String[]{"HTTP/1.1 501 Not Implemented\r\n"+ "\r\n"}){sb.append(line);System.out.println(" |---> " + line.replace("\r\n",""));}System.out.println(" | ");output.write(sb.toString().getBytes());return;}sb = new StringBuilder();nav=dir+uri.replace("//","/").trim();nav=nav.replace("//","/").replace("%20"," ");if ( ! new File(nav).isFile() ){nav+="/";int c=9;while ( nav.contains("//") && c-->0 )nav=nav.replace("//","/");for (
/* class HttpServer */ String index : new String[]{"index.html","index.htm"} ){if ( new File(nav+index).exists() ){nav+=index;break;}}}if ( uri.equals("/"+titulo_url) ){sb = new StringBuilder(); for ( String line : new String[]{"HTTP/1.1 200 OK\r\n","Content-Type: text/html; charset=UTF-8\r\n","\r\n","<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n","<html xmlns=\"http://www.w3.org/1999/xhtml\">\n","<meta charset='UTF-8' http-equiv='X-UA-Compatible' content='IE=9'>\n","<br>\n"," "+titulo+"<br>\n"}){sb.append(line);System.out.println(" |---> " + line.replace("\r\n",""));}File[] files = new File(dir).listFiles();Arrays.sort(files, new Comparator<File>() {public int compare(File f1, File f2) {return f1.lastModified()<f2.lastModified()?1:-1;}});sb.append("<style>.bordered {border: solid #ccc 3px;border-radius: 6px;}.bordered tr:hover {background: #fbf8e9;}.bordered td, .bordered th {border-left: 2px solid #ccc;border-top: 2px solid #ccc;padding: 10px;}</style>");System.out.println("<style>.bordered {border: solid #ccc 3px;border-radius: 6px;}.bordered tr:hover {background: #fbf8e9;}.bordered td, .bordered th {border-left: 2px solid #ccc;border-top: 2px solid #ccc;padding: 10px;}</style>");sb.append("<table id='tablebase' class='bordered' style='font-family:Verdana,sans-serif;font-size:10px;border-spacing: 0;'>");System.out.println("<table id='tablebase' class='bordered' style='font-family:Verdana,sans-serif;font-size:10px;border-spacing: 0;'>");for ( File p : files){if ( ! p.isFile() ) continue;if ( ! endsWith_OK(p.getName(),endsWiths) ) continue;sb.append("<tr><td>" + new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date(p.lastModified())).toString() + "</td><td>" + "<a href='" + p.getName() + "'>" + p.getName() + "</a></td></tr>\n");System.out.println("<tr><td>" + new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date(p.lastModified())).toString() + "</td><td>" + "<a href='" + p.getName() + "'>" + p.getName() + "</a></td></tr>\n");}sb.append("</table></html>");System.out.println("</table></html>");System.out.println(" | ");output.write(sb.toString().getBytes());return;}System.out.println("nav: "+nav+";uri: "+uri);if ( new File(nav).exists() && new File(nav).isFile() && endsWith_OK(nav,endsWiths) ){for ( String line : new String[]{"HTTP/1.1 200 OK\r\n"+ "Content-Type: "+ getContentType(nav)+ "; charset=UTF-8\r\n"+ "\r\n"}){sb.append(line);System.out.println(" |---> " + line.replace("\r\n",""));}System.out.println(" | ");output.write(sb.toString().getBytes());try{System.out.println("iniciando leitura do arquivo: " + nav);transf_bytes(output,nav);System.out.println("finalizando leitura do arquivo: " + nav);return;}catch(Exception e){System.out.println("erro 404, não foi possivel ler o arquivo: " + nav);}}else{System.out.println("nao encontrou o arquivo: " + nav);if ( uri.equals("/favicon.ico") ){return;}}/* ERROR 404 */sb = new StringBuilder();for ( String line : new String[]{"HTTP/1.1 200 OK\r\n","Content-Type: text/html; charset=UTF-8\r\n","\r\n","<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n" +"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +"<head>\n" +"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"/>\n" +"<title>404 - File or directory not found.</title>\n" +"<style type=\"text/css\">\n" +"<!--\n" +"body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\n" +"fieldset{padding:0 15px 10px 15px;} \n"
/* class HttpServer */ +"h1{font-size:2.4em;margin:0;color:#FFF;}\n" +"h2{font-size:1.7em;margin:0;color:#CC0000;} \n" +"h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \n" +"#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\n" +"background-color:#555555;}\n" +"#content{margin:0 0 0 2%;position:relative;}\n" +".content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\n" +"-->\n" +"</style>\n" +"</head>\n" +"<body>\n" +"<div id=\"header\"><h1>Server Error</h1></div>\n" +"<div id=\"content\">\n" +" <div class=\"content-container\"><fieldset>\n" +" <h2>404 - File or directory not found.</h2>\n" +" <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>\n" +" </fieldset></div>\n" +"</div>\n" +"</body>\n" +"</html>"}){sb.append(line);System.out.println(" |---> " + line.replace("\r\n",""));}System.out.println(" | ");output.write(sb.toString().getBytes());}private String getContentType(String caminho) {if ( caminho.endsWith(".html") || caminho.endsWith(".htm") )return "text/html";if ( caminho.endsWith(".css") )return "text/css";if ( caminho.endsWith(".png") || caminho.endsWith(".ico") || caminho.endsWith(".jpg") )return "image/png";return "application/octet-stream";}public byte[] lendo_arquivo(String caminho) throws Exception {FileInputStream fis=null;File file = new File(caminho);byte[] bFile = new byte[(int) file.length()];fis = new FileInputStream(file);fis.read(bFile);fis.close();return bFile;}public ArrayList<String> lendo_arquivo_display(String caminho) throws Exception {ArrayList<String> result=new ArrayList<String>();String strLine;try{FileReader rf=new FileReader(caminho);BufferedReader in=new BufferedReader(rf);while ((strLine = in.readLine()) != null)result.add(strLine);in.close();rf.close();}catch (Exception e){throw new Exception("nao foi possivel encontrar o arquivo "+caminho);}return result;}private void transf_bytes(OutputStream output, String nav) throws Exception {int count;DataInputStream dis=new DataInputStream(new FileInputStream(nav));byte[] buffer = new byte[8192];while ((count = dis.read(buffer)) > 0)output.write(buffer, 0, count);}private boolean endsWith_OK(String url,String ends){if ( ends.equals("") ) return true;String [] partes = ends.split(",");for ( int i=0;i<partes.length;i++ )if ( url.endsWith("."+partes[i]) )return true;return false;}}
/* class Wget */ //String [] args2 = {"-h"};
/* class Wget */ //String [] args2 = {"-ban","%d0","-only_before","-list_mp3","-list_diretories","http://195.122.253.112/public/mp3/"};
/* class Wget */ //String [] args2 = {"-list_files_and_diretories","http://www.dcbasso.rsn86.com/arquivos/Musicas/"};
/* class Wget */ //String [] args2 = {"-accep_escape_host_mp3","-list_files_and_diretories","http://openwebindex.com/mp3/music/"};
/* class Wget */ //String [] args2 = {"-accep_escape_host_mp3","-list_mp3","-list_diretories","http://www.brain-magazine.com"};
/* class Wget */ //String [] args2 = {"-only_before","-list_mp3","-list_diretories","http://moransa.com/music/"};
/* class Wget */ //String [] args2 = {"-r","http://www.blesscosmetics.com.br/","-list_files","-list_diretories","-output|C:\\Users\\ywanes\\Documents"};
/* class Wget */ //String [] args2 = {"-r","http://www.blesscosmetics.com.br/","-output|C:\\Users\\ywanes\\Documents"};
/* class Wget */ //String [] args2 = {"-r","http://www.naosalvo.com.br/","-output|C:\\Users\\ywanes\\Documents"};
/* class Wget */ //String [] args2 = {"http://moransa.com/music/Guns%20N'%20Roses%20-%20Appetite%20for%20Destruction/","-only_before","-output|C:\\Users\\ywanes\\Documents","-tipo|.ini|.jpg"};
/* class Wget */ //String [] args2 = {"-list_mp3","-only_before","http://jeankulle.free.fr/ftp/sons/"};
/* class Wget */ //String [] args2 = {"-list_mp3","-only_before","http://percyvanrijn.com/music/"};
/* class Wget */ //String [] args2 = {"-list_mp3","-only_before","https://notendur.hi.is/gvr/music/Big%20Whiskey%20and%20the%20GrooGrux%20King/"};
/* class Wget */ class Wget { public int cont; public boolean list_mp3=false; public String motor=""; Hashtable hashtable = new Hashtable(); int hash_cont=0; private boolean list_files=false; private boolean list_diretorios=false; public ArrayList<String> pilha=new ArrayList<String>(); private boolean accep_escape_host_mp3=false; private boolean only_before=false; private String string_only_before=null; private boolean ban=false; private String string_ban=null; private boolean recursive=false; private String string_output_dir=""; public String sep=""; private String tipo=""; public String proxy=""; public boolean legend=false; public String parametros [][] = { {"-output|","pasta de arquivo de saida ex:-output|c:\\user\\usuario\\Documents"}, { "http://site.com.br","site da utilizacao"}, {"-r","recursivo, download do site todo"}, {"-h","help, mostra parametros"}, {"-list_mp3","listar as mp3s"}, {"-list_files","listar os arquivos"}, {"-list_diretories","listar os diretorios"}, {"-accep_escape_host_mp3","aceitar navegação de outro host por url mp3"}, {"-tipo|.mp3|.wma","baixar somente arquivos com estas extensoes"}, { "-only_before","somente navegação da url de uma ponto pra frente"} , { "-proxy|","ex: -proxy|endereco-proxy|80"}, {"-ban","palava ou caracter banido, ex -ban %d0"}, {"-legend","colocando 1 arquivo A, 2 arquivo B ... "}, }; String parametros() { String retorno=""; for ( int i=0;i<parametros.length;i++){ retorno+=parametros[i][0]+" => "+parametros[i][1]+"\n"; } return retorno; } void comando(String comando) { if ( comando.startsWith("-output|")){ string_output_dir=comando.split("\\|")[1]; return; } if ( comando.startsWith("-tipo|")){ tipo=comando.replace("-tipo\\|",""); return; } if ( ban && string_ban == null ){ string_ban=comando; return; } if ( comando.equals("-ban") ){ ban=true; return; } if ( comando.equals("-r") ){ recursive=true; only_before=true; return; } if ( comando.equals("-list_mp3") ){ list_mp3=true; return; } if ( comando.equals("-list_files") ){ list_files=true; return; } if ( comando.equals("-list_diretories") ){ list_diretorios=true; return; } if ( comando.equals("-accep_escape_host_mp3") ){ accep_escape_host_mp3=true; return; } if ( comando.equals("-only_before") ){ only_before=true; return; } if ( comando.equals("-legend") ){ legend=true; return; } if ( comando.startsWith("-proxy|") ){ comando=comando.replace("-proxy|",""); if ( comando.split("\\|").length != 2 ){ throw new Error("Comando "+comando+" invalido "+comando.split("|").length+" "+comando); } proxy=comando; return; } if ( comando.contains("-h") ){ System.out.println("Parametros:"); System.out.println(parametros()); System.exit(0); } if ( ! comando.startsWith("-")){ fix_barra_url(comando); return; } throw new Error("Comando "+comando+" invalido"); } public void start_motor() throws Exception{ if ( ! motor.equals("")){ cont=0; if ( recursive || ! tipo.equals("")){ if (string_output_dir.equals("")){ throw new Exception("erro, falta do parametro -output|[dir], necessario com o parametro -r ou -tipo "); }else{ if ( ! new File(string_output_dir).exists() ){ throw new Exception("erro, o diretorio "+string_output_dir + " nao existe."); }else{ grava(get_raiz(motor),"dir"); } } } motor(motor); } } public void motor(String url) throws Exception{ if ( url_invalida(url) ){ return; } if ( only_before ){ if ( string_only_before == null ){ string_only_before=url;
/* class Wget */ }else{ if ( ! url.contains(string_only_before)){ return; } } } if ( url.contains("#")){ url=fix_sharp(url); } if ( url.contains("/../") ){ url=fix_dotdot(url); } if ( ! url.endsWith("/") && ! get_life(url).contains(".")){ url+="/"; } if ( url_de_request(url) ){ if ( list_diretorios && url.endsWith("/")){ if ( legend ){ System.out.println("pasta "+url); }else{ System.out.println(url); } } String html = getcode(url); if ( ! html.equals("")){ boolean tmp_tipo=false; if ( ! tipo.equals("")){ for ( String ext : tipo.split("\\|")){ if ( url.toLowerCase().endsWith(ext)){ tmp_tipo=true; } } } if ( recursive || tmp_tipo ){ grava(url,"file"); } for ( String parametro : gethref(html) ){ if ( ! parametro.equals("") && ! parametro.contains("?") && ! parametro.contains(" ")){ if ( ban && string_ban != null && parametro.contains(string_ban)){ }else{ motor(monta_url(url,parametro)); } } } } }else{ if ( (list_mp3 && url.toLowerCase().endsWith(".mp3")) || list_files ){ if ( legend ){ System.out.println(++cont+" arquivo "+url); }else{ System.out.println(url); } } boolean tmp_tipo=false; if ( ! tipo.equals("")){ for ( String ext : tipo.split("\\|")){ if ( url.toLowerCase().endsWith(ext)){ tmp_tipo=true; } } } if ( recursive || tmp_tipo ){ grava(url,"file"); } } } public boolean url_invalida(String url) throws Exception{ if ( url.length() > 1000){ throw new Exception("erro inesperado ! "+url); } url=url.trim(); if ( hashtable.contains(new String(url)) ){ return true; } hashtable.put(hash_cont++,url); if ( url.contains(";") && ! url.contains("&")){ return true; } return false; } public ArrayList<String> gethref(String texto){ ArrayList<String> lista=new ArrayList<String>(); Matcher m; m = Pattern.compile(" href=\"([^\"])*").matcher(texto); while ( m.find() ){ lista.add(m.group().substring(7)); } m = Pattern.compile(" HREF=\"([^\"])*").matcher(texto); while ( m.find() ){ lista.add(m.group().substring(7)); } m = Pattern.compile(" href='([^'])*").matcher(texto); while ( m.find() ){ lista.add(m.group().substring(7)); } m = Pattern.compile(" HREF='([^'])*").matcher(texto); while ( m.find() ){ lista.add(m.group().substring(7)); } m = Pattern.compile(" src='([^'])*").matcher(texto); while ( m.find() ){ lista.add(m.group().substring(6)); } m = Pattern.compile(" SRC='([^'])*").matcher(texto); while ( m.find() ){ lista.add(m.group().substring(6)); } return lista; } public String getcode(String url){ String texto=""; String inputLine=""; HttpURLConnection httpcon=null; BufferedReader in=null; try{ URLConnection con=null; if ( proxy.equals("")){ con=new URL(url).openConnection(); }else{ con=new URL(url).openConnection( new Proxy(Proxy.Type.HTTP, new InetSocketAddress( proxy.split("\\|")[0], Integer.parseInt(proxy.split("\\|")[1])))); } con.setUseCaches(false); (httpcon = (HttpURLConnection) con).addRequestProperty("User-Agent", "Mozilla/4.76"); if ( httpcon.getResponseCode() != 503 ){ in = new BufferedReader(new InputStreamReader(httpcon.getInputStream())); while ((inputLine = in.readLine()) != null) texto+=inputLine; in.close(); return texto; } return ""; }catch (Exception e){ if ( true )return ""; } return texto; } public boolean mp3_realmente(String url){ String inputLine; int cont=0; try{ URL UrL=new URL(url); URLConnection con; con=UrL.openConnection(); HttpURLConnection httpcon = (HttpURLConnection) con; httpcon.addRequestProperty("User-Agent", "Mozilla/6.0");
/* class Wget */ BufferedReader in = new BufferedReader(new InputStreamReader(httpcon.getInputStream())); cont=0; while ((inputLine = in.readLine()) != null && cont < 50){ cont++; } in.close(); }catch (Exception e){} if ( cont == 50 ){ return true; } return false; } public void fix_barra_url(String comando){ if ( ! comando.toLowerCase().startsWith("http://") && ! comando.toLowerCase().startsWith("https://") ){ comando="http://"+comando; } if ( quantidade_de_barra(comando) == 0){ comando+="/"; } motor=comando; } private String fix_dotdot(String url2) { boolean final_com_barra=url2.endsWith("/"); reset_pilha(); for ( String pasta : url2.split("/")){ if ( pasta.equals("..") ){ resempilha(); }else{ empilha(pasta); } } String retorno=""; for ( String pasta : pilha ){ retorno+=pasta+"/"; } if ( ! final_com_barra ){ retorno=retorno.substring(0,retorno.length()-1); } return retorno; } private void reset_pilha() { pilha=new ArrayList<String>(); } private void resempilha() { if ( pilha.size() > 0 ){ pilha.remove(pilha.size()-1); } } private void empilha(String pasta) { pilha.add(pasta); } private String tira_file_da_url(String url2) { while ( ! url2.endsWith("/")){ url2=url2.substring(0,url2.length()-1); } return url2; } private String fix_sharp(String incremento) { if ( incremento.contains("#") ){ boolean ignore=false; String incremento_aux=""; for ( int i=0;i<incremento.length() && ! ignore;i++){ if ( incremento.substring(i,i+1).equals("#")){ ignore=true; }else{ incremento_aux+=incremento.substring(i,i+1); } } return incremento_aux; } return incremento; } private int quantidade_de_barra(String comando) { comando=tira_http(comando); int cont=0; for ( int i=0;i<comando.length();i++){ if ( comando.substring(i,i+1).equals("/")){ cont++; } } return cont; } private boolean url_de_request(String url) { url=url.toLowerCase(); if ( url.endsWith("/") || url.contains(".asp") || url.contains(".php") || url.contains(".html") || url.contains(".htm") || url.contains(".apsx") ){ return true; } if ( pasta(url) ){ return true; } return false; } private boolean pasta(String url) { url=url.replace("http://",""); String u=""; for ( String p : url.split("/")) { u=p; } if ( ! u.contains(".")){ return true; } return false; } private String get_raiz(String url) { url=tira_http(url); return "http://"+url.split("/")[0]; } private String tira_http(String comando) { return comando.replace("http://",""); } private String monta_url(String url, String parametro) { if ( parametro.startsWith("http://")){ return parametro; }else{ if ( parametro.startsWith("/")){ return get_raiz(url)+parametro; }else{ if ( ! parametro.contains(".") && ! parametro.endsWith("/")){ parametro+="/"; } if ( url.endsWith("/")){ return url+parametro; }else{ if ( ! tira_file(url).equals("") ){ return tira_file(url)+parametro; } return url+"/"+parametro; } } } } private String tira_file(String url) { url=tira_http(url); String tmp="",retorno="http://"; for ( String pasta : url.split("/")){ if ( ! tmp.equals("")){ if ( pasta.contains(".")){ return retorno; } }else{ tmp=pasta; } retorno+=pasta+"/"; } return ""; } private void grava(String conteudo,String tipo) { if ( string_output_dir.contains("\\")){ sep="\\"; }else{ sep="/"; } if ( tipo.equals("dir")){ conteudo=string_output_dir+sep+tira_http(conteudo); if ( ! new File(conteudo).exists() ){ new File(conteudo).mkdir(); } }else{ download(conteudo); } } private void download(String conteudo) {
/* class Wget */ String path=string_output_dir+sep; String aux=""; for ( String pasta : tira_http(tira_file_da_url(conteudo)).split("/")){ path+=pasta+sep; aux=path.replace("%20"," "); if ( ! new File(aux).exists() ){ new File(aux).mkdir(); } } String file=get_life(conteudo); if ( ! conteudo.contains("?")){ System.out.println("Salvando: "+conteudo); if ( file.equals("")){ file="index.html"; if ( ! new File(path+file).exists() ){ String html = getcode(conteudo); try{ aux=(path+file).replace("%20"," "); FileWriter fstream = new FileWriter(aux); BufferedWriter out = new BufferedWriter(fstream); out.write(html); out.close(); }catch (Exception e){ System.err.println("Error: " + e.getMessage()); } } }else{ aux=(path+file).replace("%20"," "); if ( ! new File(aux).exists() ){ new UrlDownload().fileDownload(conteudo,path,proxy); } } } } private String get_life(String url) { url=tira_http(url); String tmp="",retorno="http://"; for ( String pasta : url.split("/")){ if ( ! tmp.equals("")){ if ( pasta.contains(".")){ return pasta; } }else{ tmp=pasta; } retorno+=pasta+"/"; } return ""; } public static class UrlDownload { final static int size=1024; public static void fileUrl(String fAddress, String localFileName, String destinationDir,String proxy) { String aux=""; if ((new File(destinationDir+"\\"+localFileName)).exists()) { System.out.println("Arquivo " + localFileName + " ja exite."); return; }else{ OutputStream outStream = null; URLConnection uCon = null; InputStream is = null; try { URL Url; byte[] buf; int ByteRead,ByteWritten=0; aux=(destinationDir+"\\"+localFileName).replace("%20"," "); outStream = new BufferedOutputStream(new FileOutputStream(aux)); if ( proxy.equals("")){ uCon=new URL(fAddress).openConnection(); }else{ uCon=new URL(fAddress).openConnection( new Proxy(Proxy.Type.HTTP, new InetSocketAddress( proxy.split("\\|")[0], Integer.parseInt(proxy.split("\\|")[1])))); } is = uCon.getInputStream(); buf = new byte[size]; while ((ByteRead = is.read(buf)) != -1) { outStream.write(buf, 0, ByteRead); ByteWritten += ByteRead; } is.close(); outStream.close(); }catch (Exception e) { } } } public static void fileDownload(String fAddress, String destinationDir,String proxy) { int slashIndex =fAddress.lastIndexOf('/'); int periodIndex =fAddress.lastIndexOf('.'); String fileName=fAddress.substring(slashIndex + 1); if (periodIndex >=1 && slashIndex >= 0 && slashIndex < fAddress.length()-1) { if(fileName.contains("?")){ String tmp []=fileName.split("="); fileName=tmp[0]; fileName=fileName.substring(0, fileName.length()-2); } fileUrl(fAddress,fileName,destinationDir,proxy); }else{ System.err.println("path or file name."); } } } }
/* class by manual */ class Arquivos{
/* class by manual */ public String lendo_arquivo_pacote(String caminho){
/* class by manual */ if ( caminho.equals("/y/manual") )
/* class by manual */ return ""
/* class by manual */ + "usage:\n"
/* class by manual */ + " [y banco fromCSV -outTable tabelaA selectInsert]\n"
/* class by manual */ + " [y banco conn,hash [select|selectInsert|selectCSV] [|select..]]\n"
/* class by manual */ + " [y banco conn,hash executeInsert]\n"
/* class by manual */ + " [y banco conn,hash execute [|execute..]]\n"
/* class by manual */ + " [y banco conn,hash createjobexecute]\n"
/* class by manual */ + " [y banco [connIn,hash|fileCSV,file] connOut,hash -outTable tabelaA [|trunc|createTable] [carga|createjobcarga]]\n"
/* class by manual */ + " [y banco executejob]\n"
/* class by manual */ + " [y banco buffer [|-n_lines 500] [|-log buffer.log]]\n"
/* class by manual */ + " [y selectCSV]\n"
/* class by manual */ + " [y xlsxToCSV]\n"
/* class by manual */ + " [y token]\n"
/* class by manual */ + " [y gettoken]\n"
/* class by manual */ + " [y zip]\n"
/* class by manual */ + " [y gzip]\n"
/* class by manual */ + " [y gunzip]\n"
/* class by manual */ + " [y echo]\n"
/* class by manual */ + " [y printf]\n"
/* class by manual */ + " [y cat]\n"
/* class by manual */ + " [y md5]\n"
/* class by manual */ + " [y sha1]\n"
/* class by manual */ + " [y sha256]\n"
/* class by manual */ + " [y aes]\n"
/* class by manual */ + " [y base64]\n"
/* class by manual */ + " [y grep]\n"
/* class by manual */ + " [y wc -l]\n"
/* class by manual */ + " [y head]\n"
/* class by manual */ + " [y tail]\n"
/* class by manual */ + " [y cut]\n"
/* class by manual */ + " [y sed]\n"
/* class by manual */ + " [y n]\n"
/* class by manual */ + " [y rn]\n"
/* class by manual */ + " [y [bytesToInts|bi]]\n"
/* class by manual */ + " [y [intsToBytes|ib]]\n"
/* class by manual */ + " [y od]\n"
/* class by manual */ + " [y touch]\n"
/* class by manual */ + " [y iconv]\n"
/* class by manual */ + " [y tee]\n"
/* class by manual */ + " [y uniq]\n"
/* class by manual */ + " [y quebra]\n"
/* class by manual */ + " [y seq]\n"
/* class by manual */ + " [y awk print]\n"
/* class by manual */ + " [y dev_null]\n"
/* class by manual */ + " [y dev_in]\n"
/* class by manual */ + " [y scp]\n"
/* class by manual */ + " [y execSsh]\n"
/* class by manual */ + " [y ssh]\n"
/* class by manual */ + " [y sftp]\n"
/* class by manual */ + " [y serverRouter]\n"
/* class by manual */ + " [y httpServer]\n"
/* class by manual */ + " [y wget]\n"
/* class by manual */ + " [y help]\n"
/* class by manual */ + "\n"
/* class by manual */ + "Exemplos...\n"
/* class by manual */ + "\n"
/* class by manual */ + "[y banco fromCSV -outTable tabelaA selectInsert]\n"
/* class by manual */ + " cat arquivo.csv | y banco fromCSV -outTable tabelaA selectInsert\n"
/* class by manual */ + "[y banco conn,hash [select|selectInsert|selectCSV] [|select..]]\n"
/* class by manual */ + " echo \"select 1 from dual\" | y banco conn,hash select\n"
/* class by manual */ + " y banco conn,hash select \"select 1 from dual\"\n"
/* class by manual */ + " echo \"select * from tabela1\" | y banco conn,hash selectInsert\n"
/* class by manual */ + " cat select.sql | y banco conn,hash selectCSV\n"
/* class by manual */ + " y banco -conn conn.. selectInsert\n"
/* class by manual */ + "[y banco conn,hash executeInsert]\n"
/* class by manual */ + " cat listaDeInsert.sql | y banco conn,hash executeInsert\n"
/* class by manual */ + " echo \"insert into tabela1 values(1,2,3)\" | y banco conn,hash executeInsert\n"
/* class by manual */ + " echo \"insert into tabela1 values(1,2,3);\" | y banco conn,hash executeInsert\n"
/* class by manual */ + "[y banco conn,hash execute [|execute..]]\n"
/* class by manual */ + " echo \"truncate table tabela1\" | y banco conn,hash execute\n"
/* class by manual */ + " y banco conn,hash execute \"drop table tabela1\"\n"
/* class by manual */ + " cat blocoAnonimo | y banco conn,hash execute\n"
/* class by manual */ + "[y banco conn,hash createjobexecute]\n"
/* class by manual */ + " echo \"truncate table tabela1\" | y banco conn,hash createjobexecute\n"
/* class by manual */ + "[y banco [connIn,hash|fileCSV,file] connOut,hash -outTable tabelaA [|trunc|createTable] [carga|createjobcarga]]\n"
/* class by manual */ + " echo \"select * from TABELA_AAA\" | y banco connIn,hash connOut,hash -outTable TABELA_BBB carga\n"
/* class by manual */ + " echo \"select * from TABELA_AAA\" | y banco connIn,hash connOut,hash -outTable TABELA_BBB trunc carga\n"
/* class by manual */ + " echo \"select * from TABELA_AAA\" | y banco connIn,hash connOut,hash -outTable TABELA_BBB createTable carga\n"
/* class by manual */ + " y banco -fileCSV arquivo.csv connOut,hash -outTable TABELA_CCC carga\n"
/* class by manual */ + " y banco -fileCSV arquivo.csv connOut,hash -outTable TABELA_CCC trunc carga\n"
/* class by manual */ + " y banco -fileCSV arquivo.csv connOut,hash -outTable TABELA_CCC createTable carga\n"
/* class by manual */ + "[y banco executejob]\n"
/* class by manual */ + " (\n"
/* class by manual */ + " echo \"select * from TABELA_AAA\" | y banco connIn,hash connOut,hash -outTable TABELA_BBB trunc createjobcarga\n"
/* class by manual */ + " echo \"select * from TABELA_CCC\" | y banco connIn,hash connOut,hash -outTable TABELA_CCC trunc createjobcarga\n"
/* class by manual */ + " ) | y banco executejob\n"
/* class by manual */ + "[y banco buffer [|-n_lines 500] [|-log buffer.log]] \n"
/* class by manual */ + " echo \"select * from TABELA1 | y banco conn,hash selectInsert | y banco buffer -n_lines 500 -log buffer.log | y banco conn,hash executeInsert\n"
/* class by manual */ + "[y selectCSV]\n"
/* class by manual */ + " y cat file.csv | y selectCSV \"select * from this\"\n"
/* class by manual */ + " y selectCSV -csv file.csv \"select * from this\"\n"
/* class by manual */ + " y selectCSV -csv file.csv -sql consulta.sql\n"
/* class by manual */ + "[y xlsxToCSV]\n"
/* class by manual */ + " xlsxToCSV arquivo.xlsx mostraEstrutura\n"
/* class by manual */ + " xlsxToCSV arquivo.xlsx listaAbas\n"
/* class by manual */ + " xlsxToCSV arquivo.xlsx numeroAba 1\n"
/* class by manual */ + " xlsxToCSV arquivo.xlsx nomeAba Planilha1\n"
/* class by manual */ + " xlsxToCSV arquivo.xlsx exportAll\n"
/* class by manual */ + " obs: pegando a primeira aba => xlsxToCSV arquivo.xlsx numeroAba 1\n"
/* class by manual */ + "[y xml]\n"
/* class by manual */ + " cat arquivo.xml | mostraEstrutura\n"
/* class by manual */ + " xml arquivo.xml mostraEstrutura\n"
/* class by manual */ + " cat arquivo.xml | mostraTags\n"
/* class by manual */ + "[y token]\n"
/* class by manual */ + " y token value\n"
/* class by manual */ + "[y gettoken]\n"
/* class by manual */ + " y gettoken hash\n"
/* class by manual */ + "[y zip]\n"
/* class by manual */ + " y zip add File1.txt > saida.zip\n"
/* class by manual */ + " cat File1.txt | y zip add -name File1.txt > saida.zip\n"
/* class by manual */ + " y zip add /pasta1 > saida.zip\n"
/* class by manual */ + " y zip list arquivo.zip\n"
/* class by manual */ + " cat arquivo.zip | y zip list\n"
/* class by manual */ + " y zip extract entrada.zip\n"
/* class by manual */ + " cat entrada.zip | y zip extract\n"
/* class by manual */ + " y zip extract entrada.zip -out /destino\n"
/* class by manual */ + " cat entrada.zip | y zip extract -out /destino\n"
/* class by manual */ + " y zip extractSelected entrada.zip pasta1/unicoArquivoParaExtrair.txt -out /destino\n"
/* class by manual */ + " cat entrada.zip | y zip extractSelected pasta1/unicoArquivoParaExtrair.txt -out /destino\n"
/* class by manual */ + " y zip extractSelected entrada.zip pasta1/unicoArquivoParaExtrair.txt > /destino/unicoArquivoParaExtrair.txt\n"
/* class by manual */ + " cat entrada.zip | y zip extractSelected pasta1/unicoArquivoParaExtrair.txt > /destino/unicoArquivoParaExtrair.txt\n"
/* class by manual */ + " obs: se add pasta e a descricao de pasta tem \"/\" ou \"\\\\\" entao o pacote tera o conteudo da pasta, caso contrario tera a pasta citada+conteudo.\n"
/* class by manual */ + "[y gzip]\n"
/* class by manual */ + " cat arquivo | y gzip > arquivo.gz\n"
/* class by manual */ + "[y gunzip]\n"
/* class by manual */ + " cat arquivo.gz | y gunzip > arquivo\n"
/* class by manual */ + "[y echo]\n"
/* class by manual */ + " echo a b c\n"
/* class by manual */ + " echo \"a b c\"\n"
/* class by manual */ + "[y printf]\n"
/* class by manual */ + " echo a b c\n"
/* class by manual */ + " echo \"a b c\"\n"
/* class by manual */ + " obs: diferente do echo, o printf nao gera \\n no final\n"
/* class by manual */ + "[y cat]\n"
/* class by manual */ + " y cat arquivo\n"
/* class by manual */ + "[y md5]\n"
/* class by manual */ + " cat arquivo | y md5\n"
/* class by manual */ + "[y sha1]\n"
/* class by manual */ + " cat arquivo | y sha1\n"
/* class by manual */ + "[y sha256]\n"
/* class by manual */ + " cat arquivo | y sha256\n"
/* class by manual */ + "[y aes]\n"
/* class by manual */ + " cat arquivo | y aes SENHA | y base64\n"
/* class by manual */ + " cat arquivo | y aes -e SENHA | y base64\n"
/* class by manual */ + " cat arquivo | y aes -d SENHA | y base64\n"
/* class by manual */ + " cat arquivo | y aes -e SENHA -md MD5 | y base64\n"
/* class by manual */ + " cat arquivo | y aes -e SENHA -md SHA256 | y base64\n"
/* class by manual */ + " cat arquivo | y aes -e SENHA -md SHA-256 | y base64\n"
/* class by manual */ + " cat arquivo | y aes -e SENHA -md MD5 -S AAAAAAAAAAAAAAAA | y base64\n"
/* class by manual */ + " obs: O comando \"y aes -e SENHA -md MD5 -S AAAAAAAAAAAAAAAA\" equivale a \"openssl aes-256-cbc -e -k SENHA -md MD5 -S AAAAAAAAAAAAAAAA\"\n"
/* class by manual */ + " obs2: O valor de salt(-S) devera conter 16 hexas maiusculos, ex: AAAAAAAAAAAAAAAA\n"
/* class by manual */ + "[y base64]\n"
/* class by manual */ + " cat arquivo | y base64\n"
/* class by manual */ + " cat arquivo | y base64 -d\n"
/* class by manual */ + " y base64 -e \"texto\"\n"
/* class by manual */ + " y base64 -d \"YQ==\"\n"
/* class by manual */ + " y printf \"texto\" | base64 -e \n"
/* class by manual */ + " obs: -e para encode e -d para decode\n"
/* class by manual */ + "[y grep]\n"
/* class by manual */ + " cat arquivo | y grep ^Texto$\n"
/* class by manual */ + " cat arquivo | y grep AB\n"
/* class by manual */ + " cat arquivo | y grep -i -v aa bb cc\n"
/* class by manual */ + "[y wc -l]\n"
/* class by manual */ + " cat arquivo | y wc -l\n"
/* class by manual */ + "[y head]\n"
/* class by manual */ + " cat arquivo | y head\n"
/* class by manual */ + " cat arquivo | y head -30\n"
/* class by manual */ + "[y tail]\n"
/* class by manual */ + " cat arquivo | y tail\n"
/* class by manual */ + " cat arquivo | y tail -30\n"
/* class by manual */ + "[y cut]\n"
/* class by manual */ + " cat arquivo | y cut -c-10\n"
/* class by manual */ + " cat arquivo | y cut -c5-10\n"
/* class by manual */ + " cat arquivo | y cut -c5-\n"
/* class by manual */ + " cat arquivo | y cut -c5\n"
/* class by manual */ + " cat arquivo | y cut -c5-10,15-17\n"
/* class by manual */ + "[y sed]\n"
/* class by manual */ + " cat arquivo | y sed A B\n"
/* class by manual */ + " cat arquivo | y sed A B E F\n"
/* class by manual */ + " obs: sed com dois parametros e performatico e aceita por exemplo \\n como quebra\n"
/* class by manual */ + "[y n]\n"
/* class by manual */ + " cat arquivo | y n\n"
/* class by manual */ + " obs: modifica arquivo \\r\\n para \\n(se ja tiver \\n nao tem problema)\n"
/* class by manual */ + "[y rn]\n"
/* class by manual */ + " cat arquivo | y rn\n"
/* class by manual */ + " obs: modifica arquivo \\n para \\r\\n(se ja tiver \\r\\n nao tem problema)\n"
/* class by manual */ + "[y [bytesToInts|bi]]\n"
/* class by manual */ + " cat arquivo | y bytesToInts\n"
/* class by manual */ + " cat arquivo | y bi\n"
/* class by manual */ + " cat arquivo | y bi -128\n"
/* class by manual */ + " obs entrada: arquivo binario\n"
/* class by manual */ + " obs saida: lista de numeros bytes(0..255)\n"
/* class by manual */ + " obs2 bi == bytesToInts\n"
/* class by manual */ + "[y [intsToBytes|ib]]\n"
/* class by manual */ + " echo 55 | y intsToBytes\n"
/* class by manual */ + " cat arquivo | y intsToBytes\n"
/* class by manual */ + " cat arquivo | y ib\n"
/* class by manual */ + " y intsToBytes 20 20\n"
/* class by manual */ + " y ib 20 20\n"
/* class by manual */ + " obs entrada: lista de numeros bytes(0..255)\n"
/* class by manual */ + " obs saida: arquivo binario\n"
/* class by manual */ + " obs2 por conceito, os bytes variam entre -128..127, mas aqui usaremos 0..255\n"
/* class by manual */ + " obs3 ib == intsToBytes\n"
/* class by manual */ + "[y od]\n"
/* class by manual */ + " cat arquivo | od\n"
/* class by manual */ + " cat arquivo | od -bc\n"
/* class by manual */ + " cat arquivo | od -bcr\n"
/* class by manual */ + " obs: -r mostra numero bytes\n"
/* class by manual */ + "[y touch]\n"
/* class by manual */ + " y touch fileA\n"
/* class by manual */ + " y touch fileA -3600\n"
/* class by manual */ + " y touch fileA 60\n"
/* class by manual */ + " y touch fileA 20210128235959\n"
/* class by manual */ + " obs: 60(60 segundos a frente)\n"
/* class by manual */ + " obs2: -3600(3600 segundos atras)\n"
/* class by manual */ + " obs3: 20210128235959(setando em 28/01/2021 23:59:59)\n"
/* class by manual */ + "[y iconv]\n"
/* class by manual */ + " y iconv -f UTF-8 -t ISO-8859-1 file\n"
/* class by manual */ + " cat file | y iconv -f UTF-8 -t ISO-8859-1 \n"
/* class by manual */ + " cat file | y iconv -f ISO-8859-1 -t UTF-8\n"
/* class by manual */ + " obs: tipos suportados: \"ISO-8859-1\",\"UTF-8\",\"UTF-8BOM\",\"UCS-2LE\",\"UCS-2LEBOM\"\n"
/* class by manual */ + " obs2: convert UTF-8 para ISO-8859-1(padrao windows, equivalente ao ANSI do notepad e equivalente ao windows-1252)\n"
/* class by manual */ + " obs3: BOM do UTF-8 em numerico => 239 187 191\n"
/* class by manual */ + " obs4: BOM do UCS-2LE em numerico => 255 254\n"
/* class by manual */ + "[y tee]\n"
/* class by manual */ + " cat arquivo | y tee saida.txt\n"
/* class by manual */ + "[y uniq]\n"
/* class by manual */ + " cat arquivo | y uniq\n"
/* class by manual */ + "[y quebra]\n"
/* class by manual */ + " cat arquivo | y quebra\n"
/* class by manual */ + "[y seq]\n"
/* class by manual */ + " y seq 1 10 2\n"
/* class by manual */ + " y seq 5 7\n"
/* class by manual */ + " y seq 9 -10\n"
/* class by manual */ + "[y awk]\n"
/* class by manual */ + " cat arquivo | y awk print 1 3 5,6\n"
/* class by manual */ + " cat arquivo | y awk print -1\n"
/* class by manual */ + " cat arquivo | y awk start AAA end BBB \n"
/* class by manual */ + " cat arquivo | y awk start AAA\n"
/* class by manual */ + " cat arquivo | y awk end BBB \n"
/* class by manual */ + " cat arquivo | y awk -v start AAA end BBB \n"
/* class by manual */ + " cat arquivo | y awk -v start AAA\n"
/* class by manual */ + " cat arquivo | y awk -v end BBB \n"
/* class by manual */ + " obs: \"-v\" e a negativa\n"
/* class by manual */ + " obs2: start e end pode ocorrer varias vezes no texto\n"
/* class by manual */ + " obs3: -1 significa o ultimo\n"
/* class by manual */ + "[y dev_null]\n"
/* class by manual */ + " cat arquivo | y banco buffer -n_lines 500 -log buffer.log | y dev_null\n"
/* class by manual */ + "[y dev_in]\n"
/* class by manual */ + " y dev_in | y banco buffer -n_lines 500 -log buffer.log | y dev_null\n"
/* class by manual */ + "[y scp]\n"
/* class by manual */ + " y scp file1 user,pass@servidor:file2\n"
/* class by manual */ + " y scp file1 user,pass@servidor:file2 22\n"
/* class by manual */ + " y scp user,pass@servidor:file1 file2\n"
/* class by manual */ + " y scp user,pass@servidor:file1 file2 22\n"
/* class by manual */ + " comando para windows nao testado abaixo:\n"
/* class by manual */ + " y scp user,pass@servidor:/c/temp file2 22\n"
/* class by manual */ + " obs: user,pass ou user\n"
/* class by manual */ + "[y execSsh]\n"
/* class by manual */ + " y execSsh user,pass@servidor command\n"
/* class by manual */ + " y execSsh user,pass@servidor command 22\n"
/* class by manual */ + " obs: user,pass ou user\n"
/* class by manual */ + "[y ssh]\n"
/* class by manual */ + " y ssh user,pass@servidor\n"
/* class by manual */ + " y ssh user,pass@servidor 22\n"
/* class by manual */ + " obs: user,pass ou user\n"
/* class by manual */ + "[y sftp]\n"
/* class by manual */ + " y sftp user,pass@servidor\n"
/* class by manual */ + " y sftp user,pass@servidor 22\n"
/* class by manual */ + " obs: user,pass ou user\n"
/* class by manual */ + "[y serverRouter]\n"
/* class by manual */ + " y serverRouter 192.168.0.100 8080 localhost 9090\n"
/* class by manual */ + " y serverRouter 192.168.0.100 8080 localhost 9090 show\n"
/* class by manual */ + " y serverRouter 192.168.0.100 8080 localhost 9090 showOnlySend\n"
/* class by manual */ + " y serverRouter 192.168.0.100 8080 localhost 9090 showOnlyReceive\n"
/* class by manual */ + " y serverRouter 192.168.0.100 8080 localhost 9090 displaySimple\n"
/* class by manual */ + " y serverRouter localhost 8080 localhost 9090\n"
/* class by manual */ + " y serverRouter localhost 8080 localhost 9090 show\n"
/* class by manual */ + " y serverRouter localhost 8080 localhost 9090 showOnlySend\n"
/* class by manual */ + " y serverRouter localhost 8080 localhost 9090 showOnlyReceive\n"
/* class by manual */ + " y serverRouter localhost 8080 localhost 9090 showSimple\n"
/* class by manual */ + " obs:\n"
/* class by manual */ + " 192.168.0.100 -> ip a se conectar(se colocar localhost ele vai tentar pegar o ip correto)\n"
/* class by manual */ + " 8080 -> porta para conectar no router\n"
/* class by manual */ + " localhost -> local que o serverRouter conecta(use nome da maquina ou ip)\n"
/* class by manual */ + " 9090 -> porta que o serverRouter conecta\n"
/* class by manual */ + "[y TESTEserver]\n"
/* class by manual */ + " y TESTEserver 9090\n"
/* class by manual */ + " y TESTEserver 192.168.0.100 9090\n"
/* class by manual */ + "[y TESTEclient]\n"
/* class by manual */ + " y TESTEclient localhost 8080\n"
/* class by manual */ + "[y httpServer]\n"
/* class by manual */ + " y httpServer\n"
/* class by manual */ + " obs: o comando acima ira criar um httpServer temporario com parametros padroes\n"
/* class by manual */ + " y httpServer localhost pagina_toke_zzz111 \"Lista de arquivos\" 8888 \"/dir\" \"\" \"\"\n"
/* class by manual */ + " parametros: host(pode ser \"\"), titulo_url, titulo, port, dir, endsWiths(ex: \"\",\"jar,zip\"), ips_banidos(ex: \"\",\"8.8.8.8,4.4.4.4\")\n"
/* class by manual */ + "[y wget]\n"
/* class by manual */ + " y wget -h\n"
/* class by manual */ + "[y help]\n"
/* class by manual */ + " y help <command>\n"
/* class by manual */ + " y help router\n"
/* class by manual */ + "\n"
/* class by manual */ + "Exemplo de conn: -conn \"jdbc:oracle:thin:@//host_name:1521/service_name|login|senha\"\n"
/* class by manual */ + "Exemplo de conn: -conn \"jdbc:oracle:thin:@host_name:1566:sid_name|login|senha\"\n"
/* class by manual */ + "\n"
/* class by manual */ + "Observacoes:\n"
/* class by manual */ + "entrada de dados pode ser feito por |\n"
/* class by manual */ + "export STATUS_FIM_Y=path/fim.log para receber a confirmacao de fim de processamento de selectCSV\n"
/* class by manual */ + "export COUNT_Y=path/count.log para receber a quantidade de linhas geradas no CSV(sem o header) do comando selectCSV\n"
/* class by manual */ + "export CSV_SEP_Y=\"|\" para utilizar um separador diferente, pode ser usado tanto em leitura de csv quanto gravacao\n"
/* class by manual */ + "export CSV_ONLYCHAR_Y=\"S\" usado para nao imprimir aspas duplas em numericos, pode ser usado na gravacao de csv, quanto a leitura de csv nao precisa, a leitura ja interpreta automaticamente isso\n"
/* class by manual */ + "export FORMAT_DATA_Y=\"TZ\" deixando a data 10/10/2010T10:10:10Z\n"
/* class by manual */ + "export FORMAT_DATA_Y=\"UTC\" deixando a data 10/10/2010 10:10:10 UTC\n"
/* class by manual */ + "export FORMAT_DATA_Y=\"NATAL\" toda data sera na data do natal ex 25/12/2010 10:10:15\n"
/* class by manual */ + "export FORMAT_DATA_Y=\"YYYY-MM-DD\" 2010-07-07 12:12:12\n"
/* class by manual */ + "export COM_SEPARADOR_FINAL_CSV_Y=\"S\" ex: \"a\";\"a\"; o padrao seria \"a\";\"a\"\n"
/* class by manual */ + "export SEM_HEADER_CSV_Y=\"S\"\n"
/* class by manual */ + "\n"
/* class by manual */ + "Dica: copiar o arquivo hash do token pra o nome do banco. cd $TOKEN_Y;cp 38b3492c4405f98972ba17c0a3dc072d servidor;\n"
/* class by manual */ + "Dica2: vendo os tokens: grep \":\" $TOKEN_Y/*\n"
/* class by manual */ + "Dica3: vendo warnnings ORA: cat $ORAs_Y\n"
/* class by manual */ + "\n"
/* class by manual */ + "alias no windows(criar arquivo c:\\Windows\\System32\\y.bat com o conteudo abaixo):\n"
/* class by manual */ + "@echo off\n"
/* class by manual */ + "java -cp c:\\\\y;c:\\\\y\\\\ojdbc6.jar;c:\\\\y\\\\sqljdbc4-3.0.jar;c:\\\\y\\\\jsch-0.1.55.jar Y %1 %2 %3 %4 %5 %6 %7 %8 %9\n"
/* class by manual */ + "\n"
/* class by manual */ + "alias no linux:\n"
/* class by manual */ + "alias y='java -cp /y:/y/ojdbc6.jar:/y/sqljdbc4-3.0.jar:/y/jsch-0.1.55.jar Y'";
/* class by manual */ if ( caminho.equals("/y/ORAs") )
/* class by manual */ return ""
/* class by manual */ + "ORA-00911\n"
/* class by manual */ + "ORA-00913\n"
/* class by manual */ + "ORA-00917\n"
/* class by manual */ + "ORA-00928\n"
/* class by manual */ + "ORA-00933\n"
/* class by manual */ + "ORA-00936\n"
/* class by manual */ + "ORA-00947\n"
/* class by manual */ + "ORA-00972\n"
/* class by manual */ + "ORA-01756\n"
/* class by manual */ + "ORA-01742\n"
/* class by manual */ + "ORA-01747\n"
/* class by manual */ + "ORA-01438";
/* class by manual */ if ( caminho.equals("/y/sql_get_ddl_createtable") )
/* class by manual */ return ""
/* class by manual */ + " with\n"
/* class by manual */ + " FUNCTION func_fix_create_table(p_campo CLOB) RETURN CLOB AS \n"
/* class by manual */ + " vCampo CLOB;\n"
/* class by manual */ + " vResultado CLOB;\n"
/* class by manual */ + " vC VARCHAR2(2);\n"
/* class by manual */ + " vStart VARCHAR2(1);\n"
/* class by manual */ + " vContador number;\n"
/* class by manual */ + " \n"
/* class by manual */ + " BEGIN\n"
/* class by manual */ + " vCampo := p_campo;\n"
/* class by manual */ + " vStart := 'N';\n"
/* class by manual */ + " vResultado := '';\n"
/* class by manual */ + " vContador := 0;\n"
/* class by manual */ + " \n"
/* class by manual */ + " FOR i IN 1..LENGTH(vCampo)\n"
/* class by manual */ + " LOOP \n"
/* class by manual */ + " vC := substr(vCampo,i,1);\n"
/* class by manual */ + " \n"
/* class by manual */ + " IF ( vC = '(' OR vC = 'C' OR vC = 'c' ) THEN\n"
/* class by manual */ + " vStart := 'S';\n"
/* class by manual */ + " END IF;\n"
/* class by manual */ + " \n"
/* class by manual */ + " IF ( vC = '(' ) THEN\n"
/* class by manual */ + " vContador := vContador + 1;\n"
/* class by manual */ + " END IF;\n"
/* class by manual */ + " \n"
/* class by manual */ + " IF ( vStart = 'S' ) THEN\n"
/* class by manual */ + " vResultado := vResultado || vC;\n"
/* class by manual */ + " END IF;\n"
/* class by manual */ + " \n"
/* class by manual */ + " IF ( vC = ')' ) THEN\n"
/* class by manual */ + " vContador := vContador - 1;\n"
/* class by manual */ + " IF ( vContador = 0 ) THEN \n"
/* class by manual */ + " EXIT;\n"
/* class by manual */ + " END IF;\n"
/* class by manual */ + " END IF;\n"
/* class by manual */ + " END LOOP;\n"
/* class by manual */ + " \n"
/* class by manual */ + " return vResultado || ';';\n"
/* class by manual */ + " \n"
/* class by manual */ + " END func_fix_create_table;\n"
/* class by manual */ + " select func_fix_create_table(dbms_metadata.get_ddl('TABLE',UPPER('[TABELA]'),UPPER('[SCHEMA]'))) TXT from dual";
/* class by manual */ if ( caminho.equals("/y/versao") )
/* class by manual */ return ""
/* class by manual */ + "0.1.0";
/* class by manual */ return "";
/* class by manual */ }
/* class by manual */ }
| 48.848108 | 4,017 | 0.487511 |
abfd867642ac4f1ea9a725b0eefa09c0b0a5ab0d | 138 | rb | Ruby | db/migrate/20200511150020_rename_journey_details_to_vehicle.rb | ministryofjustice/hmpps-book-secure-move-api | 79e1012dfdc535dfcab0e2540896cdae63e09b9c | [
"MIT"
] | 11 | 2020-01-09T13:12:09.000Z | 2022-02-14T15:04:52.000Z | db/migrate/20200511150020_rename_journey_details_to_vehicle.rb | ministryofjustice/hmpps-book-secure-move-api | 79e1012dfdc535dfcab0e2540896cdae63e09b9c | [
"MIT"
] | 305 | 2019-08-06T08:10:01.000Z | 2022-03-28T08:59:43.000Z | db/migrate/20200511150020_rename_journey_details_to_vehicle.rb | ministryofjustice/hmpps-book-secure-move-api | 79e1012dfdc535dfcab0e2540896cdae63e09b9c | [
"MIT"
] | 4 | 2020-02-21T13:42:10.000Z | 2021-04-11T06:13:57.000Z | class RenameJourneyDetailsToVehicle < ActiveRecord::Migration[5.2]
def change
rename_column :journeys, :details, :vehicle
end
end
| 23 | 66 | 0.775362 |
7343b75f05740b80f3f3c800bca4072fb6609e71 | 1,441 | swift | Swift | TimeRecorder/TimeRecorder/Common/View/TableViewCell/EditDateTableViewCell.swift | LeoZhou1986/TimeRecorder | 219cd3e81cc780ce0f06bbee1d18dc1b49ed1fff | [
"MIT"
] | 1 | 2019-03-13T21:18:35.000Z | 2019-03-13T21:18:35.000Z | TimeRecorder/TimeRecorder/Common/View/TableViewCell/EditDateTableViewCell.swift | LeoZhou1986/TimeRecorder | 219cd3e81cc780ce0f06bbee1d18dc1b49ed1fff | [
"MIT"
] | null | null | null | TimeRecorder/TimeRecorder/Common/View/TableViewCell/EditDateTableViewCell.swift | LeoZhou1986/TimeRecorder | 219cd3e81cc780ce0f06bbee1d18dc1b49ed1fff | [
"MIT"
] | null | null | null | //
// EditDateTableViewCell.swift
// TimeRecorder
//
// Created by Leo Zhou on 2019/3/22.
// Copyright © 2019 LeoZhou. All rights reserved.
//
import UIKit
class EditDateTableViewCell: BaseEditRecordTableViewCell {
var date: Date? {
didSet {
// 判断日期是今天
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm"
dateText.text = formatter.string(from: date!)
}
}
var dateText: UITextField = {
let textField = UITextField()
textField.translatesAutoresizingMaskIntoConstraints = false
textField.textColor = UIColor.black
textField.isUserInteractionEnabled = false
return textField
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
container.addSubview(dateText)
NSLayoutConstraint.activate([
dateText.heightAnchor.constraint(equalTo: container.heightAnchor, multiplier: 0.65),
dateText.widthAnchor.constraint(equalTo: container.widthAnchor),
dateText.leftAnchor.constraint(equalTo: titleText.leftAnchor),
dateText.topAnchor.constraint(equalTo: titleText.bottomAnchor),
])
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
| 30.659574 | 96 | 0.648161 |
76c9ff60f64cbd89491e4d213b5f5d9e62c10fd5 | 1,179 | h | C | Validation/Performance/bin/constants.h | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Validation/Performance/bin/constants.h | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Validation/Performance/bin/constants.h | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | #ifndef CONSTANTS_H_
#define CONSTANTS_H_
const double RESOLUTION_DEFAULT = 2.0; /* secs (normally 2.0) */
const int RANDOM_SEED = 101010;
/* default: small (cache-contained) problem sizes */
const int FFT_SIZE = 1024; /* must be a power of two */
const int SOR_SIZE = 100; /* NxN grid */
const int SPARSE_SIZE_M = 1000;
const int SPARSE_SIZE_nz = 5000;
const int LU_SIZE = 100;
/* large (out-of-cache) problem sizes */
const int LG_FFT_SIZE = 1048576; /* must be a power of two */
const int LG_SOR_SIZE = 1000; /* NxN grid */
const int LG_SPARSE_SIZE_M = 100000;
const int LG_SPARSE_SIZE_nz = 1000000;
const int LG_LU_SIZE = 1000;
/* tiny problem sizes (used to mainly to preload network classes */
/* for applet, so that network download times */
/* are factored out of benchmark.) */
/* */
const int TINY_FFT_SIZE = 16; /* must be a power of two */
const int TINY_SOR_SIZE = 10; /* NxN grid */
const int TINY_SPARSE_SIZE_M = 10;
const int TINY_SPARSE_SIZE_N = 10;
const int TINY_SPARSE_SIZE_nz = 50;
const int TINY_LU_SIZE = 10;
#endif
| 33.685714 | 71 | 0.638677 |
2a23d261066241d914746c7901a436c17be200c5 | 11,625 | java | Java | src/main/java/hobby/wei/c/remote/api/Api.java | bdo-cash/assoid | 5f02d57c5ff4e83de8c8d03aa8d1840a6a90c288 | [
"Apache-2.0"
] | 1 | 2017-11-10T10:00:11.000Z | 2017-11-10T10:00:11.000Z | src/main/java/hobby/wei/c/remote/api/Api.java | bdo-cash/assoid | 5f02d57c5ff4e83de8c8d03aa8d1840a6a90c288 | [
"Apache-2.0"
] | null | null | null | src/main/java/hobby/wei/c/remote/api/Api.java | bdo-cash/assoid | 5f02d57c5ff4e83de8c8d03aa8d1840a6a90c288 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright (C) 2017-present, Chenai Nakam(chenai.nakam@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package hobby.wei.c.remote.api;
import java.util.HashMap;
import java.util.Map;
import hobby.wei.c.data.abs.IParser;
import hobby.wei.c.remote.INetAces.Method;
/**
* 网络接口数据缓存配置。
* 与网络接口有关的任务,缓存全部存入一个接口专用的通用数据库表。
* 是否访问网络跟缓存配置有关。除正常情况`先读缓存后读网络`以外,访问网络【之前】是否访问【缓存】数据库跟具体的任务类型有关。分为两种情况:
* 1、虽然有缓存,但仍强制访问网络:如登录。应该直接访问网络而不应先访问缓存数据库(登录需要的参数应该在之前的任务中读取);
* 2、即使有网络连接,即使缓存为空,也只读缓存而不访问网络:如获取上次登录的用户信息。由于登录之后获取的用户信息是存入接口专用表的,
* 因此需要访问接口专用表,但是接口专用表是不允许其他非网络接口任务使用的,因此需要配置为接口任务,但是不访问网络。
*
* @author Wei Chou(weichou2010@gmail.com)
* @version 1.0, xx/xx/2013
*/
public abstract class Api {
public final static long DAY_TIME_MS = 24 * 60 * 60 * 1000;
protected abstract String key4Uid();
protected abstract String key4Passport();
protected abstract String key4PageNum();
protected abstract String key4PageSize();
protected abstract int maxPageSize();
/**
* 全局唯一的名字,所有Api配置中不可重复。
* 这里把一个特定接口“controller、参数个数、参数类型”三者的组合看作一个 Category,因此对于同一个 controller 有不同参数的组合的情况,
* 仅通过 controller 无法标识一个特定类型的请求(Category),因此通过 name 标识。
*/
public final String name;
public final String baseUrl;
public final String controller;
public final int method;
/**
* passport放到header里面。
*/
public final boolean passport;
/**
* 是否分页。
*/
public final boolean pagination;
public final Map<String, String> headers;
public final String[] params;
public final String[] defValues;
/**
* 作为缓存key生成条件的参数,必须包含于 params。要求这些值对于一条记录是不变的且足够标识一条记录。
* 注意:pageSize 是不应该有的;对于与用户有关的数据,userId 会自动设置为一个参数,这里不需要添加。
*/
public final String[] cacheParams;
/**
* 缓存时间,小于 0 表示没有缓存,0表示无限缓存,不用写入缓存时间。大于 0 则需要写入缓存时间。单位:毫秒。
*/
public final long cacheTimeMS;
/**
* 数据解析器。
*/
public final IParser parser;
public Api(String url, String controller, int method, String[] params, long cacheTimeMS, IParser parser) {
this(null, url, controller, method, false, params, null, params, cacheTimeMS, parser);
}
public Api(String url, String controller, int method, String[] params,
String[] cacheParams, long cacheTimeMS, IParser parser) {
this(null, url, controller, method, false, params, null, cacheParams, cacheTimeMS, parser);
}
public Api(String name, String url, String controller, int method, boolean passport, String[] params, String[] defValues,
String[] cacheParams, long cacheTimeMS, IParser parser) {
this(name, url, controller, method, passport, null, params, defValues, cacheParams, cacheTimeMS, parser);
}
public Api(String name, String baseUrl, String controller, int method, boolean passport, Map<String, String> headers, String[] params,
String[] defValues, String[] cacheParams, long cacheTimeMS, IParser parser) {
if (name == null || name.length() == 0) name = null;
if (controller == null || controller.length() == 0) controller = null;
baseUrl = baseUrl.trim().toLowerCase();
if (!baseUrl.startsWith("http")) throw new IllegalArgumentException("baseUrl必须以`http`开头");
if (controller != null) {
controller = controller.trim();
if (!controller.matches(REGEX)) throw new IllegalArgumentException("controller含有非法字符`" + controller + "`,参见正则`" + REGEX + "`。");
if (!baseUrl.endsWith("/")) throw new IllegalArgumentException("当controller不为空时,baseUrl必须以`/`结尾。");
} else {
if (baseUrl.endsWith("/")) throw new IllegalArgumentException("当controller为空时,baseUrl不能以`/`结尾。");
}
if (name != null) {
name = name.trim();
if (!name.matches(REGEX)) throw new IllegalArgumentException("name含有非法字符`" + name + "`,参见正则`" + REGEX + "`。");
} else {
name = controller;
if (name == null) throw new IllegalArgumentException("当controller为空时,name不能为空。");
}
if (method < Method.DEPRECATED_GET_OR_POST || method > Method.DELETE) {
throw new IllegalArgumentException("method值不正确,详见" + Method.class.getName());
}
if (defValues == null || defValues.length == 0) defValues = null;
if (defValues != null && defValues.length > params.length) throw new IllegalArgumentException("defValues长度不能大于params。可以为null。");
if (params == null || params.length == 0) params = null;
if (cacheParams == null || cacheParams.length == 0) cacheParams = null;
if (cacheTimeMS >= 0) {
int len = params == null ? 0 : params.length;
int clen = cacheParams == null ? 0 : cacheParams.length;
if (len > 0 && clen == 0) throw new IllegalArgumentException("启用了缓存,cacheParams不能为空。");
if (passport && clen == 0) throw new IllegalArgumentException("启用了缓存,且数据与用户相关(passport),cacheParams必须含有`" + key4Uid() + "`字段。");
if (passport) {
if (clen > len + 1) throw new IllegalArgumentException("启用了缓存,cacheParams长度不能超过params.length + 1。");
} else {
if (clen > len) throw new IllegalArgumentException("启用了缓存,cacheParams长度不能超过params。");
}
}
//////////////////// 避免之后其他部分代码的频繁 toLowerCase() 以及由此引发的错误 ///////////////////////////
boolean pagination = false, pageNo = false, pageSize = false;
if (params != null) {
for (int i = 0; i < params.length; i++) {
params[i] = params[i].toLowerCase();
if (!pageNo && params[i].equals(key4PageNum())) {
pagination = pageNo = true;
continue;
}
if (!pageSize && params[i].equals(key4PageSize())) {
pagination = pageSize = true;
if (defValues != null && defValues.length > i) {
int size = Integer.parseInt(defValues[i]);
if (size > maxPageSize()) throw new IllegalArgumentException("pageSize不能超过`" + maxPageSize() + "`。");
}
}
}
for (int i = 0; i < params.length; i++) {
for (int j = i + 1; j < params.length; j++) {
if (params[i].equals(params[j]))
throw new IllegalArgumentException("params不能有重复:" + params[i] + ", [" + i + "], [" + j + "]。");
}
}
}
if (pagination && !pageNo) throw new IllegalArgumentException("由于有分页,params必须含有`" + key4PageNum() + "`字段。");
if (pagination && !pageSize) throw new IllegalArgumentException("由于有分页,params必须含有`" + key4PageSize() + "`字段。");
boolean userId = pageNo = false;
if (cacheParams != null && cacheTimeMS >= 0) {
for (int i = 0; i < cacheParams.length; i++) {
cacheParams[i] = cacheParams[i].toLowerCase();
if (passport && !userId && cacheParams[i].equals(key4Uid())) {
userId = true;
continue;
}
if (pagination && !pageNo && cacheParams[i].equals(key4PageNum())) {
pageNo = true;
continue;
}
if (cacheParams[i].equals(key4PageSize())) {
throw new IllegalArgumentException("cacheParams不应该含有`" + key4PageSize() + "`字段。");
}
}
for (int i = 0; i < cacheParams.length; i++) {
for (int j = i + 1; j < cacheParams.length; j++) {
if (cacheParams[i].equals(cacheParams[j]))
throw new IllegalArgumentException("cacheParams不能有重复:" + cacheParams[i] + ", [" + i + "], [" + j + "]。");
}
}
}
if (cacheTimeMS >= 0 && passport && !userId)
throw new IllegalArgumentException("启用了缓存,数据与用户相关(passport),cacheParams必须含有`" + key4Uid() + "`字段。");
if (cacheTimeMS >= 0 && pagination && !pageNo) throw new IllegalArgumentException("启用了缓存,有分页,cacheParams必须含有`" + key4PageNum() + "`字段。");
if (cacheTimeMS >= 0) {
//////////////////// 仅检查 cacheParams 是否包含于 params /////////////////////////////////
if (cacheParams != null) {
boolean contain = false, checked = false;
for (String c : cacheParams) {
contain = false;
if (params != null) {
for (String p : params) {
if (c.equals(p)) {
contain = true;
break;
}
}
}
if (!contain) {
if (!checked && c.equals(key4Uid())) {
checked = true;
if (passport) continue;
}
throw new IllegalArgumentException("cacheParams必须包含于params。passport为true时,`" + key4Uid() + "`字段除外。");
}
}
}
}
this.name = name;
this.baseUrl = baseUrl;
this.controller = controller;
this.method = method;
this.passport = passport;
this.pagination = pagination;
this.headers = headers;
this.params = params;
this.defValues = defValues;
this.cacheParams = cacheParams;
this.cacheTimeMS = cacheTimeMS;
this.parser = parser;
}
public final Map<String, String> getMappedParams(Map<String, String> paramsMap) {
Map<String, String> taskParams = new HashMap<String, String>();
if (defValues != null) {
for (int i = 0; i < defValues.length; i++) {
taskParams.put(params[i], defValues[i]);
}
}
if (params != null) {
String value;
for (String key : params) {
value = paramsMap.get(key);
if (value != null && value.length() > 0) {
if (key.equals(key4PageSize()) && Integer.parseInt(value) > maxPageSize()) {
throw new IllegalArgumentException("pageSize不能超过`" + maxPageSize() + "`。");
}
if (key.equals(key4PageNum()) && Integer.parseInt(value) < 1) {
throw new IllegalArgumentException("pageNo不能小于1。");
}
taskParams.put(key, value);
} else if (!taskParams.containsKey(key)) {
taskParams.put(key, value);
}
}
}
if (cacheParams != null) {
for (String p : cacheParams) {
if (!taskParams.containsKey(p)) taskParams.put(p, paramsMap.get(p));
}
}
if (passport) taskParams.put(key4Passport(), paramsMap.get(key4Passport()));
return taskParams;
}
private static final String REGEX = "[A-Za-z_$]+\\d*[A-Za-z_$]*";
}
| 43.703008 | 145 | 0.557075 |
2db307652d5e8558b6d3f2205abcdb0495560a9b | 260 | html | HTML | _doc/en/0.17.0/rpc/wallet/listreceivedbyaccount.html | Keyare/syscoincore.org | 77d51b04d5b18a5d0579005cee3f473cd5524457 | [
"MIT"
] | null | null | null | _doc/en/0.17.0/rpc/wallet/listreceivedbyaccount.html | Keyare/syscoincore.org | 77d51b04d5b18a5d0579005cee3f473cd5524457 | [
"MIT"
] | 2 | 2020-02-26T11:52:33.000Z | 2021-05-20T11:29:50.000Z | _doc/en/0.17.0/rpc/wallet/listreceivedbyaccount.html | Keyare/syscoincore.org | 77d51b04d5b18a5d0579005cee3f473cd5524457 | [
"MIT"
] | null | null | null | ---
name: listreceivedbyaccount
btcversion: 0.17.0
btcgroup: wallet
permalink: en/doc/0.17.0/rpc/wallet/listreceivedbyaccount/
---
listreceivedbyaccount (Deprecated, will be removed in V0.18. To use this command, start syscoind with -deprecatedrpc=accounts)
| 26 | 126 | 0.788462 |
fb4bdf0add85d9900943c68385d5eff7bba10c53 | 4,376 | swift | Swift | Tests/ColorComponentsTests/RGBA/Platforms/RGBA+UIKitTests.swift | sersoft-gmbh/color-components | b8858c3a29848c6a178bce2aacedc46f878604f0 | [
"Apache-2.0"
] | 4 | 2021-01-14T13:34:11.000Z | 2021-11-29T23:54:55.000Z | Tests/ColorComponentsTests/RGBA/Platforms/RGBA+UIKitTests.swift | sersoft-gmbh/color-components | b8858c3a29848c6a178bce2aacedc46f878604f0 | [
"Apache-2.0"
] | 36 | 2021-02-08T07:46:48.000Z | 2022-03-31T05:09:47.000Z | Tests/ColorComponentsTests/RGBA/Platforms/RGBA+UIKitTests.swift | sersoft-gmbh/color-components | b8858c3a29848c6a178bce2aacedc46f878604f0 | [
"Apache-2.0"
] | null | null | null | import XCTest
import XCHelpers
#if canImport(UIKit)
import UIKit
#endif
import ColorComponents
final class RGBA_UIKitTests: XCTestCase {
func testUIColorCreationWithFloatingPoint() throws {
#if canImport(UIKit)
let rgb = RGB<CGFloat>(red: 0.5, green: 0.25, blue: 0.75)
let rgba = RGBA(rgb: rgb, alpha: 0.25)
let opaqueColor = UIColor(rgb)
let alphaColor = UIColor(rgba)
var (red, green, blue, alpha) = (CGFloat(), CGFloat(), CGFloat(), CGFloat())
XCTAssertTrue(opaqueColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha))
XCTAssertEqual(red, rgb.red)
XCTAssertEqual(green, rgb.green)
XCTAssertEqual(blue, rgb.blue)
XCTAssertEqual(alpha, 1)
(red, green, blue, alpha) = (0, 0, 0, 0)
XCTAssertTrue(alphaColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha))
XCTAssertEqual(red, rgba.red)
XCTAssertEqual(green, rgba.green)
XCTAssertEqual(blue, rgba.blue)
XCTAssertEqual(alpha, rgba.alpha)
#else
try skipUnavailableAPI()
#endif
}
func testCreationFromUIColorWithFloatingPoint() throws {
#if canImport(UIKit)
let red: CGFloat = 0.5
let green: CGFloat = 0.25
let blue: CGFloat = 0.75
let alpha: CGFloat = 0.25
let color = UIColor(red: red, green: green, blue: blue, alpha: alpha)
let rgb = RGB<CGFloat>(color)
let rgba = RGBA<CGFloat>(color)
XCTAssertEqual(rgb.red, red)
XCTAssertEqual(rgba.red, red)
XCTAssertEqual(rgb.green, green)
XCTAssertEqual(rgba.green, green)
XCTAssertEqual(rgb.blue, blue)
XCTAssertEqual(rgba.blue, blue)
XCTAssertEqual(rgba.alpha, alpha)
XCTAssertNil(RGB<InexactFloat>(exactly: NoCompsUIColor(red: red, green: green, blue: blue, alpha: alpha)))
XCTAssertNil(RGB<InexactFloat>(exactly: NoCompsUIColor(red: red, green: green, blue: blue, alpha: alpha)))
XCTAssertNil(RGB<InexactFloat>(exactly: color))
XCTAssertNil(RGB<InexactFloat>(exactly: color))
#else
try skipUnavailableAPI()
#endif
}
func testUIColorCreationWithInteger() throws {
#if canImport(UIKit)
let rgb = RGB<UInt8>(red: 0x80, green: 0x40, blue: 0xB0)
let rgba = RGBA(rgb: rgb, alpha: 0x40)
let opaqueColor = UIColor(rgb)
let alphaColor = UIColor(rgba)
var (red, green, blue, alpha) = (CGFloat(), CGFloat(), CGFloat(), CGFloat())
XCTAssertTrue(opaqueColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha))
XCTAssertEqual(red, .init(rgb.red) / 0xFF)
XCTAssertEqual(green, .init(rgb.green) / 0xFF)
XCTAssertEqual(blue, .init(rgb.blue) / 0xFF)
XCTAssertEqual(alpha, 1)
(red, green, blue, alpha) = (0, 0, 0, 0)
XCTAssertTrue(alphaColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha))
XCTAssertEqual(red, .init(rgba.red) / 0xFF)
XCTAssertEqual(green, .init(rgba.green) / 0xFF)
XCTAssertEqual(blue, .init(rgba.blue) / 0xFF)
XCTAssertEqual(alpha, .init(rgba.alpha) / 0xFF)
#else
try skipUnavailableAPI()
#endif
}
func testCreationFromUIColorWithInteger() throws {
#if canImport(UIKit)
let red: CGFloat = 0.5
let green: CGFloat = 0.25
let blue: CGFloat = 0.75
let alpha: CGFloat = 0.25
let color = UIColor(red: red, green: green, blue: blue, alpha: alpha)
let rgb = RGB<UInt8>(color)
let rgba = RGBA<UInt8>(color)
XCTAssertEqual(rgb.red, .init(red * 0xFF))
XCTAssertEqual(rgba.red, .init(red * 0xFF))
XCTAssertEqual(rgb.green, .init(green * 0xFF))
XCTAssertEqual(rgba.green, .init(green * 0xFF))
XCTAssertEqual(rgb.blue, .init(blue * 0xFF))
XCTAssertEqual(rgba.blue, .init(blue * 0xFF))
XCTAssertEqual(rgba.alpha, .init(alpha * 0xFF))
XCTAssertNil(RGB<Int8>(exactly: NoCompsUIColor(red: red, green: green, blue: blue, alpha: alpha)))
XCTAssertNil(RGB<Int8>(exactly: NoCompsUIColor(red: red, green: green, blue: blue, alpha: alpha)))
XCTAssertNil(RGB<Int8>(exactly: color))
XCTAssertNil(RGB<Int8>(exactly: color))
#else
try skipUnavailableAPI()
#endif
}
}
| 38.725664 | 114 | 0.622943 |
12ca503bfb494e5351f273b5442996f5258f3da5 | 1,159 | html | HTML | app/views/pages/catalogo/_item_1823.html | pulibrary/cicognara-rails | d47e8868b35dd4db5f3a28b623735d3be519b71d | [
"Apache-2.0"
] | 3 | 2017-02-22T20:03:52.000Z | 2019-05-24T21:57:59.000Z | app/views/pages/catalogo/_item_1823.html | pulibrary/cicognara-rails | d47e8868b35dd4db5f3a28b623735d3be519b71d | [
"Apache-2.0"
] | 343 | 2016-04-26T15:12:00.000Z | 2022-03-21T16:29:22.000Z | app/views/pages/catalogo/_item_1823.html | pulibrary/cicognara-rails | d47e8868b35dd4db5f3a28b623735d3be519b71d | [
"Apache-2.0"
] | 2 | 2016-04-26T14:56:50.000Z | 2016-04-26T22:03:09.000Z | <section xmlns="http://www.w3.org/1999/xhtml" class="catalogo-item" id="1823">
<span class="catalogo-item-label">1823.</span> <span class="catalogo-bibl"><span class="catalogo-author">Del VOLO</span>, <span class="catalogo-title"><a class="catalog-link" href="/catalog/1823">Dialogo diviso in tre mattine in 8, figurato.</a></span> D’autore anonimo, M. 55.
<div class="catalogo-note">Dedicato al sig. Marcantonio Sabatini bolognese. Quest’opera è scritta con lepidezza piuttosto fratesca: infatti è
da credersi estesa da qualche frate poiché rilevasi che l’autore aveva stampato un poemetto intitolato: Gli occhi
di Gesù.</div><div id="catalogo-note-text-1823" class="catalogo-note-search-results truncate-line-clamp">Dedicato al sig. Marcantonio Sabatini bolognese. Quest’opera è scritta con lepidezza piuttosto fratesca: infatti è
da credersi estesa da qualche frate poiché rilevasi che l’autore aveva stampato un poemetto intitolato: Gli occhi
di Gesù.</div><a id="catalogo-note-text-toggle-1823" class="catalogo-note-search-results-toggle" href="#"><i class="bi bi-caret-down"/><span>Show More</span></a>
</span></section> | 128.777778 | 295 | 0.746333 |
1e279655a33ea7b1f595d02432b5dea1e061ce0d | 2,072 | swift | Swift | XLsn0wQuora/Swift/BlockLoopViewController.swift | XLsn0w/XLsn0wQuora | 93d803a321b1696d0507df8294581c85058a2a3e | [
"MIT"
] | 10 | 2017-10-25T08:49:59.000Z | 2018-06-16T01:21:24.000Z | XLsn0wQuora/Swift/BlockLoopViewController.swift | XLsn0w/XLsn0wQuora | 93d803a321b1696d0507df8294581c85058a2a3e | [
"MIT"
] | null | null | null | XLsn0wQuora/Swift/BlockLoopViewController.swift | XLsn0w/XLsn0wQuora | 93d803a321b1696d0507df8294581c85058a2a3e | [
"MIT"
] | 1 | 2018-03-05T07:21:09.000Z | 2018-03-05T07:21:09.000Z |
import UIKit
import Dispatch
class BlockLoopViewController: UIViewController {
var block_One: ((_ text:String) -> String?)?
var closureA: ()?
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.red
typealias MyClosureType = (Int, Int) -> Int
// var myCloure:MyClosureType?
let myClosure = { (num1: Int, num2: Int) -> Int in
return num1 + num2;
}
myClosure(10, 10)
/* 方案6.推荐 先弱后强*/
weak var weakSelf = self
self.block_One = {(text) -> String? in
guard let strongSelf = weakSelf else {
return nil
}
strongSelf.view.backgroundColor = UIColor.white
return text
}
}
final func escapingBlock(WithParamter param: String,block: @escaping((_ str: String) -> Void)) -> String{
var temp = "测试"
DispatchQueue.global().async {
for i in 0...30{
temp += "\(i)"
if i == 29 {
DispatchQueue.main.async {
block(temp)
}
}
}
}
return temp
}
final func nonescapingBlock(WithParamter param: String,block: (_ str: String) -> Void) -> String{
var temp = "测试"
// DispatchQueue.global().async {
for i in 0...30{
temp += "\(i)"
if i == 29 {
// 在GCD多线程的Block中使用block会被强制使用@escaping,否则会报错
// DispatchQueue.main.async {
block(temp)
// }
}
}
// }
return temp
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if let str = self.block_One?("参数Str1") {
print("\(str)")
}
}
}
| 23.022222 | 109 | 0.440637 |
48038413916701482f03057aee6d23b86ff40a39 | 418 | asm | Assembly | oeis/323/A323641.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/323/A323641.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/323/A323641.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A323641: Triangle read by rows in which row n lists the first 2^n terms of A323642, n >= 1.
; Submitted by Jamie Morken(s1)
; 1,2,1,2,3,6,1,2,3,6,3,6,9,18,1,2,3,6,3,6,9,18,3,6,9,18,9,18,27,54,1,2,3,6,3,6,9,18,3,6,9,18,9,18,27,54,3,6,9,18,9,18,27,54,9,18,27,54,27,54,81,162,1,2,3,6,3,6,9,18,3,6,9,18,9,18,27,54,3,6,9,18,9,18,27,54,9,18
add $0,2
seq $0,323642 ; Row n of triangle A323641 when n -> infinity.
div $0,3
| 52.25 | 210 | 0.636364 |
e9ed5bed0fda4cb8bf56ceacb70e7b4dce96a198 | 1,144 | rb | Ruby | spec/models/locations/delivery_location_spec.rb | pulibrary/locations | 925f11b45eee576d7e701b1657c185de933d4ea6 | [
"MIT"
] | 3 | 2015-07-01T16:20:25.000Z | 2019-11-01T17:21:01.000Z | spec/models/locations/delivery_location_spec.rb | pulibrary/locations | 925f11b45eee576d7e701b1657c185de933d4ea6 | [
"MIT"
] | 52 | 2015-06-04T21:05:57.000Z | 2021-07-09T16:48:01.000Z | spec/models/locations/delivery_location_spec.rb | pulibrary/locations | 925f11b45eee576d7e701b1657c185de933d4ea6 | [
"MIT"
] | null | null | null | require 'spec_helper'
module Locations
describe DeliveryLocation, type: :model do
subject { FactoryGirl.create(:delivery_location) }
describe 'validations' do
it 'factory produces a valid subject' do
expect(subject.valid?).to be_truthy
end
[:label, :address, :phone_number, :contact_email, :gfa_pickup, :staff_only, :pickup_location, :digital_location].each do |a|
it "is not valid without a #{a}" do
subject.send("#{a}=", nil)
expect(subject.valid?).to be_falsey
end
end
end
describe 'holding locations association' do
it 'can have holding locations' do
holding_location = FactoryGirl.create(:holding_location)
expect {
subject.holding_locations << holding_location
}.to_not raise_error
end
it 'appends holding locations as expected' do
2.times do
holding_location = FactoryGirl.create(:holding_location)
subject.holding_locations << holding_location
end
subject.reload
expect(subject.holding_locations.count).to eq 2
end
end
end
end
| 27.902439 | 130 | 0.652098 |
2060c5218516f89ee15e1def25d4cf6e8761fe76 | 2,530 | lua | Lua | Tasks/SemanticVoxelLabeling/torch/model.lua | hero9968/ScanNet | f40fa107e35407afaee792e601effed349da270f | [
"MIT"
] | null | null | null | Tasks/SemanticVoxelLabeling/torch/model.lua | hero9968/ScanNet | f40fa107e35407afaee792e601effed349da270f | [
"MIT"
] | null | null | null | Tasks/SemanticVoxelLabeling/torch/model.lua | hero9968/ScanNet | f40fa107e35407afaee792e601effed349da270f | [
"MIT"
] | null | null | null |
-- from net-orig, add more to fc and make another deconv layer
require 'nn'
require 'cunn'
require 'cudnn'
local net = nn.Sequential()
local function MSRinit(net)
local function init(name)
for k,v in pairs(net:findModules(name)) do
local n = v.kT*v.kW*v.kH*v.nOutputPlane
v.weight:normal(0,math.sqrt(2/n))
v.bias:zero()
end
end
init'VolumetricConvolution'
return net
end
-- create net
if (opt.retrain == '' or opt.retrain == nil) then
local nf0 = 8
net:add(cudnn.VolumetricConvolution(2, nf0, 4, 3, 3, 2, 2, 2)) -- output nf0 x 30x15x15
net:add(cudnn.VolumetricBatchNormalization(nf0))
net:add(cudnn.ReLU())
net:add(cudnn.VolumetricConvolution(nf0, nf0, 1, 1, 1))
net:add(cudnn.VolumetricBatchNormalization(nf0))
net:add(cudnn.ReLU())
net:add(cudnn.VolumetricConvolution(nf0, nf0, 1, 1, 1))
net:add(cudnn.VolumetricBatchNormalization(nf0))
net:add(cudnn.ReLU())
net:add(nn.VolumetricDropout(0.2))
local nf1 = 16
net:add(cudnn.VolumetricConvolution(nf0, nf1, 4, 3, 3, 2, 2, 2)) -- output nf1 x 14x7x7
net:add(cudnn.VolumetricBatchNormalization(nf1))
net:add(cudnn.ReLU())
net:add(cudnn.VolumetricConvolution(nf1, nf1, 1, 1, 1))
net:add(cudnn.VolumetricBatchNormalization(nf1))
net:add(cudnn.ReLU())
net:add(cudnn.VolumetricConvolution(nf1, nf1, 1, 1, 1))
net:add(cudnn.VolumetricBatchNormalization(nf1))
net:add(cudnn.ReLU())
net:add(nn.VolumetricDropout(0.2))
local nf2 = 32
net:add(cudnn.VolumetricConvolution(nf1, nf2, 4, 3, 3, 2, 2, 2)) -- output nf x 6x3x3
net:add(cudnn.VolumetricBatchNormalization(nf2))
net:add(cudnn.ReLU())
net:add(cudnn.VolumetricConvolution(nf2, nf2, 1, 1, 1))
net:add(cudnn.VolumetricBatchNormalization(nf2))
net:add(cudnn.ReLU())
net:add(cudnn.VolumetricConvolution(nf2, nf2, 1, 1, 1))
net:add(cudnn.VolumetricBatchNormalization(nf2))
net:add(cudnn.ReLU())
net:add(nn.VolumetricDropout(0.2))
local bf = 1024
net:add(nn.View(nf2 * 54))
net:add(nn.Linear(nf2 * 54, bf))
net:add(cudnn.ReLU())
net:add(nn.Dropout(0.5))
net:add(nn.Linear(bf, num_classes*62))
net:add(nn.View(num_classes, 1, 62))
MSRinit(net)
else --preload network
assert(paths.filep(opt.retrain), 'File not found: ' .. opt.retrain)
print('loading previously trained network: ' .. opt.retrain)
net = torch.load(opt.retrain)
end
cudnn.convert(net, cudnn)
print('net:')
return net
| 30.853659 | 93 | 0.666403 |
85a6e923a49d3d319485cbf98f676169e64fe808 | 1,159 | js | JavaScript | misc/buffer-open-salary.js | hmisty/coding | 83bc320ba781d40c298a79c1d5b769b3df1bffb5 | [
"Unlicense"
] | 3 | 2017-08-24T01:34:58.000Z | 2021-04-22T09:21:20.000Z | misc/buffer-open-salary.js | hmisty/coding | 83bc320ba781d40c298a79c1d5b769b3df1bffb5 | [
"Unlicense"
] | 10 | 2020-01-10T08:39:16.000Z | 2022-02-15T06:57:29.000Z | misc/buffer-open-salary.js | hmisty/coding | 83bc320ba781d40c298a79c1d5b769b3df1bffb5 | [
"Unlicense"
] | 1 | 2021-04-22T09:21:24.000Z | 2021-04-22T09:21:24.000Z | /**
* Print all salaries of Buffer inc.
* Evan 2015
*/
var unit = "USD";
var role = {
"Happiness Hero": 45000,
"Content Crafter": 50000,
"Engineer": 60000,
"Desinger": 60000,
"Operations Officer": 70000,
"Executive Officer": 75000
};
var revenue = 1; //million USD
var seniority = {
"-": [0, 0],
"Senior": [0.05, 3000],
"Lead": [0.07, 4000],
"VP": [0.10, 6000],
"C-Level": [0.20, 8000],
"COO": [0.20, 10000],
"CEO": [0.20, 12000]
};
var experience = {
"Junior": 1,
"Intermediate": 1.1,
"Advanced": 1.2,
"Master": 1.3
};
var location = {
"A": 22000,
"B": 12000,
"C": 6000,
"D": 0
};
var salaryChoice = {
"Salary Choice": 10000,
"Equity Choice": 0
};
for (var r in role) {
for (var s in seniority) {
for (var e in experience) {
for (var l in location) {
for (var c in salaryChoice) {
var base = role[r] * (1 + seniority[s][0]);
var salary = base * experience[e] + seniority[s][1] * revenue + location[l] + salaryChoice[c];
console.log("%s, %s, %s, %s, %s => %s",
r, s, e, l, c,
salary);
}
}
}
}
}
| 20.696429 | 104 | 0.509922 |
3ac03b6077c3f616fae88d28549f5c246db08fd3 | 12,577 | swift | Swift | ios/engine/KMEI/KeymanEngineTests/AssociatingPackageInstallerTests.swift | ermshiperete/keyman | 0eeef1b5794fd698447584e531e2a6c1ef4c05aa | [
"MIT"
] | 1 | 2021-03-08T09:31:47.000Z | 2021-03-08T09:31:47.000Z | ios/engine/KMEI/KeymanEngineTests/AssociatingPackageInstallerTests.swift | ermshiperete/keyman | 0eeef1b5794fd698447584e531e2a6c1ef4c05aa | [
"MIT"
] | null | null | null | ios/engine/KMEI/KeymanEngineTests/AssociatingPackageInstallerTests.swift | ermshiperete/keyman | 0eeef1b5794fd698447584e531e2a6c1ef4c05aa | [
"MIT"
] | null | null | null | //
// AssociatingPackageInstallerTests.swift
// KeymanEngineTests
//
// Created by Joshua Horton on 8/6/20.
// Copyright © 2020 SIL International. All rights reserved.
//
import XCTest
@testable import KeymanEngine
class AssociatingPackageInstallerTests: XCTestCase {
var mockedURLSession: TestUtils.Downloading.URLSessionMock!
var downloadManager: ResourceDownloadManager!
let mockedSearchCallback: LanguagePickAssociator.AssociationSearcher = { lgCodes, callback in
var searchResult: [String: (KeymanPackage.Key, URL)?] = [:]
// We aren't downloading these models, so a placeholder URL is fine.
let placeholderURL = URL.init(string: "http://place.holder.com")!
lgCodes.forEach { lgCode in
switch lgCode {
case "en":
searchResult["en"] = (TestUtils.Packages.Keys.nrc_en_mtnt, placeholderURL)
case "str":
searchResult["str"] = (TestUtils.Packages.Keys.nrc_str_sencoten, placeholderURL)
default:
searchResult[lgCode] = nil
}
}
callback(searchResult)
}
override func setUp() {
// Resets resource directories for a clean slate.
// We'll be testing against actually-installed packages.
TestUtils.standardTearDown()
mockedURLSession = TestUtils.Downloading.URLSessionMock()
downloadManager = ResourceDownloadManager(session: mockedURLSession!, autoExecute: true)
}
override func tearDownWithError() throws {
TestUtils.standardTearDown()
let queueWasCleared = mockedURLSession!.queueIsEmpty
mockedURLSession = nil
if !queueWasCleared {
throw NSError(domain: "Keyman",
code: 4,
userInfo: [NSLocalizedDescriptionKey: "A test did not fully utilize its queued mock results!"])
}
}
func testKeyboardNoAssociations() throws {
guard let package = try ResourceFileManager.shared.prepareKMPInstall(from: TestUtils.Keyboards.silEuroLatinKMP) as? KeyboardKeymanPackage else {
XCTFail()
return
}
let startExpectation = XCTestExpectation()
let completeExpectation = XCTestExpectation()
let installer = AssociatingPackageInstaller(for: package,
defaultLanguageCode: "en",
downloadManager: downloadManager) { status in
if status == .starting {
startExpectation.fulfill()
} else if status == .complete {
completeExpectation.fulfill()
} else if status == .cancelled {
XCTFail()
}
}
installer.pickLanguages(withCodes: Set(["en"]))
wait(for: [startExpectation, completeExpectation], timeout: 5)
guard let userKeyboards = Storage.active.userDefaults.userKeyboards else {
XCTFail()
return
}
XCTAssertTrue(userKeyboards.contains { $0.fullID == TestUtils.Keyboards.sil_euro_latin.fullID })
XCTAssertNil(Storage.active.userDefaults.userLexicalModels)
XCTAssertEqual(ResourceFileManager.shared.installState(forPackage: TestUtils.Packages.Keys.sil_euro_latin), .installed)
XCTAssertEqual(ResourceFileManager.shared.installState(forPackage: TestUtils.Packages.Keys.nrc_en_mtnt), .none)
}
func testLexicalModelNoAssociations() throws {
guard let package = try ResourceFileManager.shared.prepareKMPInstall(from: TestUtils.LexicalModels.mtntKMP) as? LexicalModelKeymanPackage else {
XCTFail()
return
}
let startExpectation = XCTestExpectation()
let completeExpectation = XCTestExpectation()
let installer = AssociatingPackageInstaller(for: package,
defaultLanguageCode: "en",
downloadManager: downloadManager) { status in
if status == .starting {
startExpectation.fulfill()
} else if status == .complete {
completeExpectation.fulfill()
} else if status == .cancelled {
XCTFail()
}
}
installer.pickLanguages(withCodes: Set(["en"]))
wait(for: [startExpectation, completeExpectation], timeout: 5)
guard let userLexicalModels = Storage.active.userDefaults.userLexicalModels else {
XCTFail()
return
}
XCTAssertTrue(userLexicalModels.contains { $0.fullID == TestUtils.LexicalModels.mtnt.fullID })
XCTAssertNil(Storage.active.userDefaults.userKeyboards)
XCTAssertEqual(ResourceFileManager.shared.installState(forPackage: TestUtils.Packages.Keys.nrc_en_mtnt), .installed)
XCTAssertEqual(ResourceFileManager.shared.installState(forPackage: TestUtils.Packages.Keys.sil_euro_latin), .none)
}
func testKeyboardWithAssociatedLexicalModels() throws {
let mockedQuery = TestUtils.Downloading.MockResult(location: TestUtils.Queries.model_case_en, error: nil)
let mockedDownload = TestUtils.Downloading.MockResult(location: TestUtils.LexicalModels.mtntKMP, error: nil)
mockedURLSession.queueMockResult(.data(mockedQuery))
mockedURLSession.queueMockResult(.download(mockedDownload))
guard let package = try ResourceFileManager.shared.prepareKMPInstall(from: TestUtils.Keyboards.silEuroLatinKMP) as? KeyboardKeymanPackage else {
XCTFail()
return
}
let startExpectation = XCTestExpectation()
let completeExpectation = XCTestExpectation()
let installer = AssociatingPackageInstaller(for: package,
defaultLanguageCode: "en",
downloadManager: downloadManager,
withAssociators: [ .lexicalModels ]) { status in
if status == .starting {
startExpectation.fulfill()
} else if status == .complete {
completeExpectation.fulfill()
} else if status == .cancelled {
XCTFail()
}
}
installer.pickLanguages(withCodes: Set(["en"]))
wait(for: [startExpectation, completeExpectation], timeout: 5)
guard let userKeyboards = Storage.active.userDefaults.userKeyboards,
let userLexicalModels = Storage.active.userDefaults.userLexicalModels else {
XCTFail()
return
}
XCTAssertTrue(userKeyboards.contains { $0.fullID == TestUtils.Keyboards.sil_euro_latin.fullID })
XCTAssertTrue(userLexicalModels.contains { $0.fullID == TestUtils.LexicalModels.mtnt.fullID} )
XCTAssertEqual(ResourceFileManager.shared.installState(forPackage: TestUtils.Packages.Keys.sil_euro_latin), .installed)
XCTAssertEqual(ResourceFileManager.shared.installState(forPackage: TestUtils.Packages.Keys.nrc_en_mtnt), .installed)
}
func testCancellationNoAssociations() throws {
guard let package = try ResourceFileManager.shared.prepareKMPInstall(from: TestUtils.Keyboards.silEuroLatinKMP) as? KeyboardKeymanPackage else {
XCTFail()
return
}
let cancelExpectation = XCTestExpectation()
let installer = AssociatingPackageInstaller(for: package,
defaultLanguageCode: "en",
downloadManager: downloadManager) { status in
if status == .cancelled {
// When the user 'cancels' language selection, this installer should also
// signal cancellation.
cancelExpectation.fulfill()
} else {
XCTFail()
}
}
// A bit of white-box testing - sets up the closure framework
installer.initializeSynchronizationGroups()
// And the install closure, which we'll send a 'cancel' signal to.
let installClosure = installer.coreInstallationClosure()
installClosure(nil)
wait(for: [cancelExpectation], timeout: 5)
XCTAssertNil(Storage.active.userDefaults.userKeyboards)
XCTAssertNil(Storage.active.userDefaults.userLexicalModels)
}
func testCancellationWithAssociations() throws {
guard let package = try ResourceFileManager.shared.prepareKMPInstall(from: TestUtils.Keyboards.silEuroLatinKMP) as? KeyboardKeymanPackage else {
XCTFail()
return
}
// While the query should occur, the installation phase should never be reached.
// So, we don't mock the download.
let mockedQuery = TestUtils.Downloading.MockResult(location: TestUtils.Queries.model_case_en, error: nil)
mockedURLSession.queueMockResult(.data(mockedQuery))
let cancelExpectation = XCTestExpectation()
let installer = AssociatingPackageInstaller(for: package,
defaultLanguageCode: "en",
downloadManager: downloadManager,
withAssociators: [.lexicalModels]) { status in
if status == .cancelled {
// When the user 'cancels' language selection, this installer should also
// signal cancellation.
cancelExpectation.fulfill()
} else {
XCTFail()
}
}
// Heavier white-box testing this time.
installer.initializeSynchronizationGroups()
installer.constructAssociationPickers()
installer.associationQueriers?.forEach {
$0.pickerInitialized()
$0.selectLanguages(Set(["en"])) // calls the expected query
// And, since we're modeling cancellation...
$0.pickerDismissed()
}
// Finally, the install closure, which we'll send a 'cancel' signal to.
let installClosure = installer.coreInstallationClosure()
installClosure(nil)
wait(for: [cancelExpectation], timeout: 5)
XCTAssertNil(Storage.active.userDefaults.userKeyboards)
XCTAssertNil(Storage.active.userDefaults.userLexicalModels)
}
func testDeinitConstructiveCancellation() throws {
guard let package = try ResourceFileManager.shared.prepareKMPInstall(from: TestUtils.Keyboards.silEuroLatinKMP) as? KeyboardKeymanPackage else {
XCTFail()
return
}
// While the query should occur, the installation phase should never be reached.
// So, we don't mock the download.
let mockedQuery = TestUtils.Downloading.MockResult(location: TestUtils.Queries.model_case_en, error: nil)
let queryExpectation = XCTestExpectation()
mockedURLSession.queueMockResult(.data(mockedQuery), expectation: queryExpectation)
let cancelExpectation = XCTestExpectation()
do {
let installer = AssociatingPackageInstaller(for: package,
defaultLanguageCode: "en",
downloadManager: downloadManager,
withAssociators: [.lexicalModels]) { status in
// When the user 'cancels' language selection, this installer should also
// signal cancellation.
if status == .cancelled {
// First, wait to ensure that the standard query did launch.
// Otherwise, we might accidentally skip the mocked query!
self.wait(for: [queryExpectation], timeout: 4)
cancelExpectation.fulfill()
} else {
XCTFail()
}
}
// Heavier white-box testing this time.
installer.initializeSynchronizationGroups()
installer.constructAssociationPickers()
installer.associationQueriers?.forEach {
$0.pickerInitialized()
$0.selectLanguages(Set(["en"])) // calls the expected query
// De-init will trigger the 'dismiss' signal.
}
}
wait(for: [cancelExpectation], timeout: 5)
XCTAssertNil(Storage.active.userDefaults.userKeyboards)
XCTAssertNil(Storage.active.userDefaults.userLexicalModels)
}
func testDeinitUnstarted() throws {
guard let package = try ResourceFileManager.shared.prepareKMPInstall(from: TestUtils.Keyboards.silEuroLatinKMP) as? KeyboardKeymanPackage else {
XCTFail()
return
}
let cancelExpectation = XCTestExpectation()
do {
let _ = AssociatingPackageInstaller(for: package,
defaultLanguageCode: "en",
downloadManager: downloadManager,
withAssociators: [.lexicalModels]) { status in
// Since language-picking never began, no "cancelled" signal should occur.
if status == .cancelled {
cancelExpectation.fulfill()
} else {
XCTFail()
}
}
}
wait(for: [cancelExpectation], timeout: 1)
XCTAssertNil(Storage.active.userDefaults.userKeyboards)
XCTAssertNil(Storage.active.userDefaults.userLexicalModels)
}
}
| 38.227964 | 148 | 0.667727 |
233ef1659395dcff9d5b2257d0164794daed6cf0 | 1,794 | kt | Kotlin | vgscheckout/src/test/java/com/verygoodsecurity/vgscheckout/view/address/country/VGSCountryEditTextTest.kt | verygoodsecurity/vgs-checkout-android | 3f558c7bde3fa46c763d144c81c90bb83d2c9390 | [
"MIT"
] | 2 | 2021-12-28T11:50:56.000Z | 2021-12-30T12:30:21.000Z | vgscheckout/src/test/java/com/verygoodsecurity/vgscheckout/view/address/country/VGSCountryEditTextTest.kt | verygoodsecurity/vgs-checkout-android | 3f558c7bde3fa46c763d144c81c90bb83d2c9390 | [
"MIT"
] | 4 | 2021-12-20T09:15:38.000Z | 2022-01-26T12:16:18.000Z | vgscheckout/src/test/java/com/verygoodsecurity/vgscheckout/view/address/country/VGSCountryEditTextTest.kt | verygoodsecurity/vgs-checkout-android | 3f558c7bde3fa46c763d144c81c90bb83d2c9390 | [
"MIT"
] | 2 | 2021-10-23T00:57:28.000Z | 2022-02-17T15:26:32.000Z | package com.verygoodsecurity.vgscheckout.view.address.country
import android.app.Activity
import com.verygoodsecurity.vgscheckout.TestApplication
import com.verygoodsecurity.vgscheckout.collect.view.card.FieldType
import com.verygoodsecurity.vgscheckout.collect.view.internal.CountryInputField
import com.verygoodsecurity.vgscheckout.collect.widget.VGSCountryEditText
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.android.controller.ActivityController
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(application = TestApplication::class)
class VGSCountryEditTextTest {
private lateinit var activityController: ActivityController<Activity>
private lateinit var activity: Activity
private lateinit var view: VGSCountryEditText
@Before
fun setUp() {
activityController = Robolectric.buildActivity(Activity::class.java)
activity = activityController.get()
view = VGSCountryEditText(activity)
}
@Test
fun test_view() {
view.onAttachedToWindow()
val internal = view.statePreparer.getView()
Assert.assertNotNull(internal)
}
@Test
fun test_attach_view() {
view.onAttachedToWindow()
Assert.assertEquals(1, view.childCount)
}
@Test
fun test_check_internal_view() {
val internal = view.statePreparer.getView()
Assert.assertNotNull(internal)
val child = view.statePreparer.getView()
Assert.assertTrue(child is CountryInputField)
}
@Test
fun test_type() {
Assert.assertEquals(FieldType.COUNTRY, view.getFieldType())
}
} | 28.935484 | 79 | 0.753066 |
477b10f00e6303bedd75a6263e19f76f14e96ee5 | 3,114 | html | HTML | blog/c4-daily-mindfulness.html | ranjit03/Old-blog- | d5a199a2cf1d6e81485ef9ebbd80d1fe3220e2ef | [
"MIT"
] | null | null | null | blog/c4-daily-mindfulness.html | ranjit03/Old-blog- | d5a199a2cf1d6e81485ef9ebbd80d1fe3220e2ef | [
"MIT"
] | null | null | null | blog/c4-daily-mindfulness.html | ranjit03/Old-blog- | d5a199a2cf1d6e81485ef9ebbd80d1fe3220e2ef | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<title>Home </title>
<meta charset="UTF-8">
<link href = "../styles/main.css" rel = "stylesheet" type = "text/css"/>
<link href = "https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css" rel = "stylesheet" type = "text/css">
<link href = "https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css" rel = "stylesheet" type = "text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<!-- Container class is to wrap complete body of the site-->
<div class = "container center" >
<!-- This class row is for header-->
<div class = "row center" >
<h1>Ranjit Endurthi - EDA Blog</h1>
<p>A Happy life is one spent in learning, earning and yearning </p>
</div>
<!--This class row is for navigation-->
<div class = "row center">
<a class = "button button-primary" href="../index.html" >Home</a>
<a class = "button button-primary" href="Cultural.html">Cultural</a>
<a class = "button button-primary" href="Technical.html">Technical</a>
<a class = "button button-primary" href="Projects.html">Projects</a>
<a class = "button button-primary" href= "../Contact.html">Contact</a>
</div>
<!--This class is for home page description -->
<div class ="row center">
<h4>Search Inside Yourself</h4>
</div>
<!-- This class is to divide blogposts and provide links to each set of blogposts-->
<div class = "row center">
<img src = "../images/Shereef's Fireside Chat.jpg">
</div>
<div class = "container row center ">
<h5>What did you learn from your 'mindfulness conversation'? How did the other person find it?</h5>
<p>Mindfulness conversation made me grasp more from the interaction and it made me feel importance of that particular moment. Other person found that they have got a lot more attention.
</p>
<h5> Which of the three suggested techniques will you use to sustain your practice? </h5>
<p>I will be doing atleast one mindful breath a day.</p>
<h5> Any other musings?</h5>
<p>I found mindfulness is very effective if followed everyday mainly for the relaxation of mind. Even if practised 10 minutes a day regularly will have amazing results.</p>
</div>
<!--This class row is for text connect with me-->
<div class = "row center">
<h4>Connect with me </h4>
</div>
<!--This class row is for icons to connect with me-->
<div class = "row center">
<a href = "https://www.facebook.com" class = "fa fa-facebook" ></a>
<a href = "https://www.twitter.com" class = "fa fa-twitter"></a></a>
<a href = "https://www.gmail.com" class = "fa fa-google"></a>
</div>
</body>
</html> | 43.859155 | 190 | 0.598908 |
2d81a1c621ae5c2ef03eeb0d2d56982c708af498 | 2,504 | html | HTML | src/app/app-nav/app-nav.component.html | acme-bank/acme-bank-webpage | b365f766a6ce134ab2e6869c3d79b474553b8a6f | [
"Apache-2.0"
] | null | null | null | src/app/app-nav/app-nav.component.html | acme-bank/acme-bank-webpage | b365f766a6ce134ab2e6869c3d79b474553b8a6f | [
"Apache-2.0"
] | null | null | null | src/app/app-nav/app-nav.component.html | acme-bank/acme-bank-webpage | b365f766a6ce134ab2e6869c3d79b474553b8a6f | [
"Apache-2.0"
] | null | null | null | <nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
<div class="container">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#appNavbar" aria-controls="appNavbar"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" routerLink="">
<img alt="ACME Bank" src="assets/images/logo-grayscale-inverted-300x100.png">
</a>
<div class="collapse navbar-collapse" id="appNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" routerLink="">
<i class="fas fa-home" aria-hidden="true"></i> Home
</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/about">
<i class="fas fa-info-circle" aria-hidden="true"></i> About
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" id="dropdown-development" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-laptop" aria-hidden="true"></i> Development
</a>
<div class="dropdown-menu" aria-labelledby="dropdown-development">
<a class="dropdown-item" routerLink="/development">
<i class="fas fa-binoculars" aria-hidden="true"></i> Overview
</a>
<a class="dropdown-item" routerLink="/development/platform">
<i class="fas fa-server" aria-hidden="true"></i> DevOps Platform
</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" id="dropdown-architecture" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="far fa-building" aria-hidden="true"></i> Architecture
</a>
<div class="dropdown-menu" aria-labelledby="dropdown-architecture">
<a class="dropdown-item" routerLink="/architecture">
<i class="far fa-map" aria-hidden="true"></i> Overview
</a>
<a class="dropdown-item" routerLink="/architecture/loan-process">
<i class="fas fa-suitcase" aria-hidden="true"></i> Loan Process Architecture
</a>
</div>
</li>
</ul>
</div>
</div>
</nav> | 45.527273 | 147 | 0.586661 |
99d98a16d293244f2a6babbd29bd392061498666 | 4,883 | kt | Kotlin | SeanOxfordResume/app/src/main/java/com/oxford/resume/views/MenuFragmentGridRecyclerView.kt | SeanOxford/Sean-Oxford-Resume | 9676f8fd483b6a9498a20bb4b4957f94b484540d | [
"Apache-2.0"
] | null | null | null | SeanOxfordResume/app/src/main/java/com/oxford/resume/views/MenuFragmentGridRecyclerView.kt | SeanOxford/Sean-Oxford-Resume | 9676f8fd483b6a9498a20bb4b4957f94b484540d | [
"Apache-2.0"
] | null | null | null | SeanOxfordResume/app/src/main/java/com/oxford/resume/views/MenuFragmentGridRecyclerView.kt | SeanOxford/Sean-Oxford-Resume | 9676f8fd483b6a9498a20bb4b4957f94b484540d | [
"Apache-2.0"
] | null | null | null | package com.oxford.resume.views
import android.animation.Animator
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.oxford.resume.ResumeApp
import com.oxford.resume.R
import com.oxford.resume.views.fragmentViews.MenuFragmentView
import com.squareup.otto.Bus
import kotlinx.android.synthetic.main.menu_grid_view.view.*
import javax.inject.Inject
class MenuFragmentGridRecyclerView(
context: Context,
dataList: ArrayList<MenuFragmentView.MenuItem>,
callback: GridViewCallback
) : RecyclerView(context) {
@Inject
protected lateinit var mBus: Bus
interface GridViewCallback {
fun onMenuItemSelected(title: String)
}
val mCallBack = callback
var mAdapter: MenuFragmentGridAdapter? = null
init {
(context?.applicationContext as ResumeApp).myComponent.inject(this)
layoutParams = FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
layoutManager = GridLayoutManager(context, 2, GridLayoutManager.VERTICAL, false)
viewTreeObserver.addOnGlobalLayoutListener {
if (mAdapter == null) {
mAdapter = MenuFragmentGridAdapter(dataList)
adapter = mAdapter
}
}
setNestedScrollingEnabled(false)
recycledViewPool.setMaxRecycledViews(0, 16)
setRecycledViewPool(recycledViewPool)
}
public fun switchMenu(menuData: List<MenuFragmentView.MenuItem>) {
fadeOutMenu(menuData)
}
private fun fadeOutMenu(menuData: List<MenuFragmentView.MenuItem>) {
menuButtonTransition(true, menuData)
}
private fun fadeInMenu() {
menuButtonTransition(false, ArrayList<MenuFragmentView.MenuItem>())
}
public fun menuButtonTransition(fadeOut: Boolean, menuData: List<MenuFragmentView.MenuItem>) {
val animSet = AnimatorSet()
val animList = ArrayList<Animator>()
var alpha = if (fadeOut) 0f else 1f
for (i in 0 until mAdapter!!.itemCount) {
val viewButton = findViewHolderForLayoutPosition(i) as MenuViewHolder
val fadeOutImageAnim =
ObjectAnimator.ofFloat(viewButton.itemView.ImageView_menu_grid_view_image, View.ALPHA, alpha)
val fadeOutTextAnim =
ObjectAnimator.ofFloat(viewButton.itemView.TextView_menu_grid_view_text, View.ALPHA, alpha)
animList.add(fadeOutImageAnim)
animList.add(fadeOutTextAnim)
}
animSet.playTogether(animList)
animSet.duration = 500
if (fadeOut) {
animSet.addListener(object : Animator.AnimatorListener {
override fun onAnimationRepeat(animation: Animator?) {
}
override fun onAnimationCancel(animation: Animator?) {
}
override fun onAnimationStart(animation: Animator?) {
}
override fun onAnimationEnd(animation: Animator?) {
mAdapter?.setDataList(menuData)
mAdapter?.notifyDataSetChanged()
fadeInMenu()
}
})
}
animSet.start()
}
inner class MenuFragmentGridAdapter(var mList: List<MenuFragmentView.MenuItem>) :
RecyclerView.Adapter<MenuViewHolder>() {
public fun setDataList(list: List<MenuFragmentView.MenuItem>) {
mList = list
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MenuViewHolder {
val inflatedView = inflate(context, R.layout.menu_grid_view, null)
inflatedView.layoutParams = LayoutParams(0, 0)
inflatedView.layoutParams.width = resources.displayMetrics.widthPixels / 2
inflatedView.layoutParams.height = height / 3
return MenuViewHolder(inflatedView)
}
override fun getItemCount(): Int {
return mList.size
}
override fun onBindViewHolder(holder: MenuViewHolder, position: Int) {
val menuItem = mList[position]
holder.itemView.ImageView_menu_grid_view_image.setImageResource(menuItem.imageRes)
holder.itemView.ImageView_menu_grid_view_image.setColorFilter(menuItem.color)
holder.itemView.TextView_menu_grid_view_text.text = menuItem.title
holder.itemView.TextView_menu_grid_view_text.setTextColor(menuItem.color)
holder.itemView.setOnClickListener {
mCallBack.onMenuItemSelected(menuItem.title)
}
}
}
class MenuViewHolder(view: View) : ViewHolder(view)
}
| 30.905063 | 109 | 0.673766 |
ade91c458277d5cb36e4206be2f9ddf1e5060aaa | 32 | rs | Rust | src/alg/search.rs | dvshapkin/toolbox | 15704704183bebe9f87bccd2e4986abb8820b405 | [
"MIT"
] | null | null | null | src/alg/search.rs | dvshapkin/toolbox | 15704704183bebe9f87bccd2e4986abb8820b405 | [
"MIT"
] | null | null | null | src/alg/search.rs | dvshapkin/toolbox | 15704704183bebe9f87bccd2e4986abb8820b405 | [
"MIT"
] | null | null | null | pub use alg_ds::alg::search::*;
| 16 | 31 | 0.65625 |
3dd961220275d0ba8afb5de70a242024a0fd4a4b | 383 | kt | Kotlin | amadeus-android/src/main/java/com/amadeus/android/referenceData/Urls.kt | amadeus4dev/amadeus-android | fe782bc1343fa80e9f08e9c787f9421b1da0bff7 | [
"MIT"
] | 15 | 2020-04-07T10:25:07.000Z | 2022-02-19T15:58:48.000Z | amadeus-android/src/main/java/com/amadeus/android/referenceData/Urls.kt | amadeus4dev/amadeus-android | fe782bc1343fa80e9f08e9c787f9421b1da0bff7 | [
"MIT"
] | 35 | 2020-04-23T09:30:40.000Z | 2022-03-31T12:35:20.000Z | amadeus-android/src/main/java/com/amadeus/android/referenceData/Urls.kt | amadeus4dev/amadeus-android | fe782bc1343fa80e9f08e9c787f9421b1da0bff7 | [
"MIT"
] | 8 | 2020-05-15T03:17:54.000Z | 2021-12-08T09:27:09.000Z | package com.amadeus.android.referenceData
import kotlinx.coroutines.CoroutineDispatcher
import retrofit2.Retrofit
class Urls internal constructor(
retrofit: Retrofit,
dispatcher: CoroutineDispatcher
) {
/**
* A namespaced client for the
* `/v2/reference-data/urls/checkin-links` endpoints.
*/
val checkinLinks = CheckinLinks(retrofit, dispatcher)
} | 22.529412 | 57 | 0.738903 |
5d47d15958fee7f5a6f1946a0afda18f0ae2bf31 | 258 | swift | Swift | crashes-duplicates/23752-swift-valuedecl-getoverloadsignature.swift | greg/swift-compiler-crashes | c27c975aa95e7f0e511919fc508d24101c03a13b | [
"MIT"
] | null | null | null | crashes-duplicates/23752-swift-valuedecl-getoverloadsignature.swift | greg/swift-compiler-crashes | c27c975aa95e7f0e511919fc508d24101c03a13b | [
"MIT"
] | null | null | null | crashes-duplicates/23752-swift-valuedecl-getoverloadsignature.swift | greg/swift-compiler-crashes | c27c975aa95e7f0e511919fc508d24101c03a13b | [
"MIT"
] | null | null | null | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
let b{
struct Q{class A{
struct d{
class c
func b{struct c<T where h:d
var:e
{
}enum e:c
| 19.846154 | 87 | 0.74031 |
7557012d9248f90816ab0a342cf6597cbca44158 | 3,167 | c | C | Support_Software/server-002.c | MarkO-555/CoCoIO-NIC-Base-Code | f3084e1f1a351d950812ea351f777b279a2a2110 | [
"BSD-3-Clause"
] | 1 | 2021-12-12T04:03:37.000Z | 2021-12-12T04:03:37.000Z | Support_Software/server-002.c | MarkO-555/CoCoIO-NIC-Base-Code | f3084e1f1a351d950812ea351f777b279a2a2110 | [
"BSD-3-Clause"
] | null | null | null | Support_Software/server-002.c | MarkO-555/CoCoIO-NIC-Base-Code | f3084e1f1a351d950812ea351f777b279a2a2110 | [
"BSD-3-Clause"
] | 1 | 2021-12-14T04:18:19.000Z | 2021-12-14T04:18:19.000Z | /* A simple server in the internet domain using TCP
The port number is passed as an argument */
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define NUM_THREADS 5
char functions_list[NUM_THREADS][21] =
{
"Maze_Generator",
"Game_Space_Main",
"Game_AI",
"NetWork_Interface",
"PrintHello"
};
void error(const char *msg)
{
perror(msg);
exit(1);
}
void *Maze_Generator(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello World! It's me, %s ( #%ld! )\n", functions_list[tid], tid);
pthread_exit(NULL);
}
void *Game_Space_Main(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello World! It's me, %s ( #%ld! )\n", functions_list[tid], tid);
pthread_exit(NULL);
}
void *Game_AI(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello World! It's me, %s ( #%ld! )\n", functions_list[tid], tid);
pthread_exit(NULL);
}
void *NetWork_Interface(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello World! It's me, %s ( #%ld! )\n", functions_list[tid], tid);
pthread_exit(NULL);
}
void *PrintHello(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello World! It's me, %s ( #%ld! )\n", functions_list[tid], tid);
pthread_exit(NULL);
}
int main(int argc, char *argv[])
{
int sockfd, newsockfd, portno;
socklen_t clilen;
char buffer[256];
struct sockaddr_in serv_addr, cli_addr;
int n;
pthread_t threads[NUM_THREADS];
int rc;
long t;
if (argc < 2) {
fprintf(stderr,"ERROR, no port provided\n");
exit(1);
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0)
error("ERROR opening socket");
bzero((char *) &serv_addr, sizeof(serv_addr));
portno = atoi(argv[1]);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = INADDR_ANY;
serv_addr.sin_port = htons(portno);
if (bind(sockfd, (struct sockaddr *) &serv_addr,
sizeof(serv_addr)) < 0)
error("ERROR on binding");
for(t=0;t<NUM_THREADS;t++){
printf("In main: creating thread %ld\n", t);
rc = pthread_create(&threads[t], NULL, ( void * )functions_list[t], (void *)t);
if (rc){
printf("ERROR; return code from pthread_create() is %d\n", rc);
exit(-1);
}
}
listen(sockfd,5);
clilen = sizeof(cli_addr);
newsockfd = accept(sockfd,
(struct sockaddr *) &cli_addr,
&clilen);
if (newsockfd < 0)
error("ERROR on accept");
bzero(buffer,256);
n = read(newsockfd,buffer,255);
if (n < 0) error("ERROR reading from socket");
printf("Here is the message: %s\n",buffer);
n = write(newsockfd,"I got your message",18);
if (n < 0) error("ERROR writing to socket");
close(newsockfd);
close(sockfd);
/* Last thing that main() should do */
pthread_exit(NULL);
return 0;
}
| 21.691781 | 85 | 0.586675 |
40c26c5ee2a6f27e6102c213ab1871ff184d46ca | 9,642 | py | Python | test/interfaces/test_shc_client.py | mhthies/smarthomeconnect | d93d1038145285af66769ebf10589c1088b323ed | [
"Apache-2.0"
] | 5 | 2021-07-02T21:48:45.000Z | 2021-12-12T21:55:42.000Z | test/interfaces/test_shc_client.py | mhthies/smarthomeconnect | d93d1038145285af66769ebf10589c1088b323ed | [
"Apache-2.0"
] | 49 | 2020-09-18T20:05:55.000Z | 2022-03-05T19:51:33.000Z | test/interfaces/test_shc_client.py | mhthies/smarthomeconnect | d93d1038145285af66769ebf10589c1088b323ed | [
"Apache-2.0"
] | 1 | 2021-12-10T14:50:43.000Z | 2021-12-10T14:50:43.000Z | # Copyright 2020 Michael Thies <mail@mhthies.de>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
import asyncio
import datetime
import logging
import unittest
import unittest.mock
import time
from typing import NamedTuple
import aiohttp
import shc.web
import shc.interfaces.shc_client
from test._helper import ExampleReadable, InterfaceThreadRunner, ExampleWritable, ExampleSubscribable, async_test, \
ClockMock, AsyncMock
class ExampleType(NamedTuple):
the_value: float
is_it_real: bool
class SHCWebsocketClientTest(unittest.TestCase):
def setUp(self) -> None:
self.server_runner = InterfaceThreadRunner(shc.web.WebServer, "localhost", 42080)
self.client_runner = InterfaceThreadRunner(shc.interfaces.shc_client.SHCWebClient, 'http://localhost:42080')
self.server = self.server_runner.interface
self.client = self.client_runner.interface
def tearDown(self) -> None:
self.client_runner.stop()
self.server_runner.stop()
def test_subscribe(self) -> None:
self.server.api(int, "foo")
bar_object = self.server.api(ExampleType, "bar")\
.connect(ExampleReadable(ExampleType, ExampleType(42, True)))
bar_source = ExampleSubscribable(ExampleType).connect(bar_object)
client_foo = self.client.object(int, 'foo')
client_bar = self.client.object(ExampleType, 'bar')
foo_target = ExampleWritable(int).connect(client_foo)
bar_target = ExampleWritable(ExampleType).connect(client_bar)
self.server_runner.start()
self.client_runner.start()
time.sleep(0.05)
foo_target._write.assert_not_called()
bar_target._write.assert_called_once_with(ExampleType(42, True), [client_bar])
self.assertIsInstance(bar_target._write.call_args[0][0], ExampleType)
bar_target._write.reset_mock()
self.server_runner.run_coro(bar_source.publish(ExampleType(56, False), [self]))
time.sleep(0.05)
bar_target._write.assert_called_once_with(ExampleType(56, False), [client_bar])
@async_test
async def test_subscribe_error(self) -> None:
self.server.api(int, "foo")
self.server.api(ExampleType, "bar")
bar_client = self.client.object(int, 'bar')
# Creating an option with equal name should return the same object again or raise a type error
self.assertIs(self.client.object(int, 'bar'), bar_client)
with self.assertRaises(TypeError):
self.client.object(str, 'bar')
# Test raising of connection errors on startup (server is not started yet)
with self.assertRaises(aiohttp.ClientConnectionError):
self.client_runner.start()
self.server_runner.start()
# Test raising of subscription errors on startup (inexistent api object name)
# This requires that the object has a local subscriber (otherwise, subscription is skipped)
another_client = shc.interfaces.shc_client.SHCWebClient('http://localhost:42080')
foobar = another_client.object(int, 'foobar')
foobar.subscribe(ExampleWritable(int))
with self.assertRaises(shc.interfaces.shc_client.WebSocketAPIError):
await another_client.start()
def test_read(self) -> None:
self.server.api(int, "foo")
self.server.api(ExampleType, "bar")\
.connect(ExampleReadable(ExampleType, ExampleType(42, True)))
client_foo = self.client.object(int, 'foo')
client_bar = self.client.object(ExampleType, 'bar')
self.server_runner.start()
self.client_runner.start()
with self.assertRaises(shc.base.UninitializedError):
self.client_runner.run_coro(client_foo.read())
result = self.client_runner.run_coro(client_bar.read())
self.assertIsInstance(result, ExampleType)
self.assertEqual(ExampleType(42, True), result)
def test_write(self) -> None:
server_bar = self.server.api(ExampleType, "bar")
target = ExampleWritable(ExampleType).connect(server_bar)
client_bar = self.client.object(ExampleType, 'bar')
self.server_runner.start()
self.client_runner.start()
self.client_runner.run_coro(client_bar.write(ExampleType(42, True), [self]))
time.sleep(0.05)
target._write.assert_called_once_with(ExampleType(42, True), unittest.mock.ANY)
self.assertIsInstance(target._write.call_args[0][0], ExampleType)
def test_reconnect(self) -> None:
self.server.api(ExampleType, "bar")\
.connect(ExampleReadable(ExampleType, ExampleType(42, True)))
client_bar = self.client.object(ExampleType, 'bar')
bar_target = ExampleWritable(ExampleType).connect(client_bar)
self.server_runner.start()
self.client_runner.start()
bar_target._write.assert_called_once_with(ExampleType(42, True), [client_bar])
bar_target._write.reset_mock()
# We cannot use ClockMock here, since it does not support asyncio.wait()
with self.assertLogs("shc.interfaces._helper", logging.ERROR) as ctx:
self.server_runner.stop()
self.assertIn("Unexpected shutdown", ctx.output[0]) # type: ignore
self.assertIn("SHCWebClient", ctx.output[0]) # type: ignore
# Re-setup server
self.server_runner = InterfaceThreadRunner(shc.web.WebServer, "localhost", 42080)
self.server = self.server_runner.interface
self.server.api(ExampleType, "bar")\
.connect(ExampleReadable(ExampleType, ExampleType(42, True)))
# Wait for first reconnect attempt
with self.assertLogs("shc.interfaces._helper", logging.ERROR) as ctx:
time.sleep(1.1)
self.assertIn("Error in interface SHCWebClient", ctx.output[0]) # type: ignore
self.assertIn("Cannot connect to host", ctx.output[0]) # type: ignore
# Start server
self.server_runner.start()
# Wait for second reconnect attempt
with unittest.mock.patch.object(self.client._session, 'ws_connect', new=AsyncMock()) as connect_mock:
time.sleep(1)
connect_mock.assert_not_called()
time.sleep(0.3)
bar_target._write.assert_called_once_with(ExampleType(42, True), [client_bar])
def test_initial_reconnect(self) -> None:
self.client.failsafe_start = True
client_bar = self.client.object(ExampleType, 'bar')
bar_target = ExampleWritable(ExampleType).connect(client_bar)
# We cannot use ClockMock here, since the server seems to be too slow then
with self.assertLogs("shc.interfaces._helper", logging.ERROR) as ctx:
self.client_runner.start()
time.sleep(0.5)
self.assertIn("Error in interface SHCWebClient", ctx.output[0]) # type: ignore
self.assertIn("Cannot connect to host", ctx.output[0]) # type: ignore
# Start server
self.server_runner.start()
# Client should still fail due to missing API object
with self.assertLogs("shc.interfaces._helper", logging.ERROR) as ctx:
time.sleep(0.6)
self.assertIn("Error in interface SHCWebClient", ctx.output[0]) # type: ignore
self.assertIn("Failed to subscribe SHC API object 'bar'", ctx.output[0]) # type: ignore
# Re-setup server
self.server_runner.stop()
self.server_runner = InterfaceThreadRunner(shc.web.WebServer, "localhost", 42080)
self.server = self.server_runner.interface
self.server.api(ExampleType, "bar") \
.connect(ExampleReadable(ExampleType, ExampleType(42, True)))
self.server_runner.start()
# wait for second reconnect attempt
with unittest.mock.patch.object(self.client._session, 'ws_connect', new=AsyncMock()) as connect_mock:
time.sleep(1)
connect_mock.assert_not_called()
time.sleep(0.3)
bar_target._write.assert_called_once_with(ExampleType(42, True), [client_bar])
class SHCWebsocketClientConcurrentUpdateTest(unittest.TestCase):
def setUp(self) -> None:
self.server = shc.web.WebServer("localhost", 42080)
self.client = shc.interfaces.shc_client.SHCWebClient('http://localhost:42080')
def tearDown(self) -> None:
loop = asyncio.get_event_loop()
loop.run_until_complete(self.client.stop())
loop.run_until_complete(self.server.stop())
@async_test
async def test_concurrent_update(self) -> None:
foo_api = self.server.api(int, 'foo')
server_var = shc.Variable(int, initial_value=0).connect(foo_api)
foo_client = self.client.object(int, 'foo')
client_var = shc.Variable(int).connect(foo_client)
await self.server.start()
await self.client.start()
await asyncio.sleep(0.1)
self.assertEqual(0, await client_var.read())
await asyncio.gather(foo_api.write(42, [self]),
foo_client.write(56, [self]))
await asyncio.sleep(0.1)
self.assertEqual(await client_var.read(),
await server_var.read())
| 41.205128 | 120 | 0.68129 |
85c45ab98334fa54bb13717b5d851cea8d5d59d4 | 3,063 | js | JavaScript | js/d3map_setup.js | nimishgautam/covid19sweden | 0a7067779f95c67d558abfc2173200c3bcc16869 | [
"MIT"
] | 1 | 2020-05-28T15:11:45.000Z | 2020-05-28T15:11:45.000Z | js/d3map_setup.js | nimishgautam/covid19sweden | 0a7067779f95c67d558abfc2173200c3bcc16869 | [
"MIT"
] | null | null | null | js/d3map_setup.js | nimishgautam/covid19sweden | 0a7067779f95c67d558abfc2173200c3bcc16869 | [
"MIT"
] | null | null | null | var svg = d3.select("#sv_map");
var width = svg.node().getBoundingClientRect().width;
var height = svg.node().getBoundingClientRect().height;
//width = +svg.attr("width"),
//height = +svg.attr("height");
countyValues = d3.map();
countyText = d3.map();
countyMin = Number.MAX_SAFE_INTEGER;
countyMax = Number.MIN_SAFE_INTEGER;
$('#subtitle').hide();
d3.queue()
.defer(d3.json, "./data/geo/sweden-counties.topojson")
.defer(d3.csv, "./data/csv/deaths_by_region.csv", function(d){
var countyName = d['Region'];
var countyVal = +d['Totalt_antal_avlidna'] / +d['Population'];
countyValues.set(countyName, countyVal);
countyPopData[countyName] = { 'pop': +d['Population'], 'deaths': +d['Totalt_antal_avlidna'] };
countyText.set(countyName, d['Totalt_antal_avlidna'] + " (pop:\xa0" + parseInt(d["Population"]).toLocaleString()+")");
if(countyVal < countyMin){
countyMin = countyVal;
}
if(countyVal > countyMax){
countyMax = countyVal;
}
})
.await(ready);
function ready(error, topo, csvfile){
var colorScale = d3.scaleLinear()
.domain([0, countyMax])
//.range(['#ffd3d3', '#ff0000']);
.range(['#eee', '#ff0000']);
//.range(['#d0d0f9', '#ff0000']);
var path = d3.geoPath();
var projection = d3.geoMercator()
.rotate(-75)
.fitSize([width,height], topojson.feature(topo, topo.objects['sweden-counties']));
var path = d3.geoPath().projection(projection);
svg.append("g")
.attr('id', 'svgmaing')
.selectAll("path")
.data(topojson.feature(topo, topo.objects['sweden-counties']).features)
.enter()
.append("path")
// draw each region
.attr("d", function(feature){ return path(feature); })
.attr("data-desc", function(d){ return countyText.get( d.properties.name ); })
.attr("data-name", function(d){ return d.properties.name; })
.attr("data-country", "Sweden")
.attr("data-fill", function(d){
return colorScale(countyValues.get( d.properties.name ));
})
.attr('fill', function(d){
return colorScale(countyValues.get( d.properties.name ));
})
.on("mouseover", function(d){
if( d3.select(this).attr('data-name') != active_region){
d3.select(this).attr('stroke', 'grey');
}
var total_people = d3.select(this).attr('data-desc');
var display_txt = d3.select(this).attr('data-name');
if(total_people){
display_txt += " : " + total_people;
}
$('#subtitle').show();
$('#subtitle').text(display_txt);
d3.select('#subtitle')
.style('left', (d3.event.pageX) + "px")
.style('top', (d3.event.pageY - 40) + "px");
})
.on("mouseout", function(d){
if( d3.select(this).attr('data-name') != active_region){
d3.select(this).attr('stroke', 'none');
}
$('#subtitle').hide();
})
.on("click", function(d){
let selected_region = d3.select(this).attr('data-name');
if (active_region == selected_region){
active_region = "Sweden (official)";
}
else{
active_region = selected_region;
}
chart_update();
});
}
| 31.57732 | 119 | 0.618675 |
5f26b36bc960a314ee0407e3b6cef33fbe826c42 | 283 | ts | TypeScript | src/main/Client/src/app/entidades/email/email.ts | vinnypinheiro/midiafacil | 6f1557b6f53f0a17bce510a8f63159007884e2bd | [
"MIT"
] | null | null | null | src/main/Client/src/app/entidades/email/email.ts | vinnypinheiro/midiafacil | 6f1557b6f53f0a17bce510a8f63159007884e2bd | [
"MIT"
] | null | null | null | src/main/Client/src/app/entidades/email/email.ts | vinnypinheiro/midiafacil | 6f1557b6f53f0a17bce510a8f63159007884e2bd | [
"MIT"
] | null | null | null | import {DomainBase} from '../../utils/utils';
import { Cliente } from '../cliente/cliente';
import { Veiculo } from '../veiculo/veiculo';
export interface Email extends DomainBase {
tipoemail: string;
email: string;
cliente_id: Cliente;
veiculo_id: Veiculo;
} | 25.727273 | 46 | 0.667845 |
f80c9158ef4b5947241f40e410eecd0251dfa432 | 4,824 | sql | SQL | legalquiz_es.sql | kevintsukii/migrantacts | c7076c7cffad26cbafdc8e96201ee9093df9aaf0 | [
"Apache-2.0"
] | null | null | null | legalquiz_es.sql | kevintsukii/migrantacts | c7076c7cffad26cbafdc8e96201ee9093df9aaf0 | [
"Apache-2.0"
] | null | null | null | legalquiz_es.sql | kevintsukii/migrantacts | c7076c7cffad26cbafdc8e96201ee9093df9aaf0 | [
"Apache-2.0"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.2.5
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: May 04, 2015 at 06:27 AM
-- Server version: 5.5.38
-- PHP Version: 5.5.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `j555s2`
--
-- --------------------------------------------------------
--
-- Table structure for table `legalquiz`
--
CREATE TABLE `legalquiz` (
`option_id` int(7) NOT NULL,
`selection` varchar(600) NOT NULL,
`result` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
--
-- Dumping data for table `legalquiz`
--
INSERT INTO `legalquiz` (`option_id`, `selection`, `result`) VALUES
(1, 'I, or an immediate family member, was a victim of a crime committed in the US that caused me to suffer mental or physical abuse.', 'U-Visa: If you have been the victim of a crime, then you may be eligible for a U visa, a status for certain crime victims and their close family members. Crimes covered include: abduction, abusive sexual contact, blackmail, domestic violence, extortion, false imprisonment, female genital mutation, felonious assualt, foreign labor contractor fraud, hostage, incest, involuntary servitude, kidnapping, manslaughter, murder, obstruction of justice, peonage, perjury, prostitution, rape, sexual assualt, sexual exploitation, slave trade, stalking, torture, trafficking, witness tampering, unlawful criminal restraint'),
(2, 'I have been the victim of abuse caused by a spouse, parent, lawful permanent resident.', 'Regardless of your gender, if you have been abused by a US citizen or lawful permanent resident spouse, parent or adult son or daughter, then you may be eligible to file a VAWA self-petition. Abuse may be physical or psychological.'),
(3, 'I have been convicted of an aggravated felony.', 'Unfortunately, being convicted of a felony may make you ineligible for most programs. If you are currently detained, the government has established a hotline for you to call to discuss possible relief options: 855-448-6903.'),
(4, 'You are less than 18 years old and have been abused by one of your parents.', 'If you are under 18 and you have been abused, abandoned or neglected by at least one parent you may be eligible for Special Immigrant Juvenile Status.'),
(5, 'You have a spouse, parent or adult child who is a citizen.', 'To promote family unity, immigration law allows permanent residents of the United States (green card holders) to petition for certain eligible relatives to come and live permanently in the United States. A permanent resident may petition for his/her spouse'),
(6, 'You have a spouse, parent or adult child who is a green card holder.', 'Green card holders can petition for their spouse or unmarried children. They can also petition for unmarried children under 21 who are relatives.'),
(7, 'You have a spouse, parent or child who is/was in the armed forces.', 'If you are the spouse, parent, son or daughter of someone on active duty in the military, or a veteran, you may be eligible for an immigration relief program known as parole in place.'),
(8, 'At least one of your parents was a US Citizen when you were born.', 'If one or both of your parents was a US citizen when you were born, then you may already be a U.S. citizen through acquisition of citizenship.'),
(9, 'I fled my home country and am afraid of returning. Or, I was seriously harmed in my home country because of my political beliefs, nationality, sexual identity or religions.', 'You may qualify for asylum in the US. To qualify, you must show that you were seriously harmed or presently fear future serious harm by others because of your race, religion, national original, political opinion, membership in a particular social group, or sexual identity.'),
(10, 'I am not a permanent resident but have been in the US for ten continuous years or more. Additionally, being departed would cause extreme hardship to my immediate family members who are citizens or lawful permanent residents.', 'You may be eligible for cancellation of removal for non-permanent residents.'),
(11, 'I have been a permanent resident in the US for at least five years and have physically been in the US for at least seven years.', 'You may be eligible for cancellation of removal for permanent residents.'),
(12, 'None of the above apply to me', 'Search for a lowcost or pro-bono immigration legal service provider <a href="www.immigrationadvocates.org/nonprofit/legaldirectory">near</a> you.');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `legalquiz`
--
ALTER TABLE `legalquiz`
ADD PRIMARY KEY (`option_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `legalquiz`
--
ALTER TABLE `legalquiz`
MODIFY `option_id` int(7) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=13; | 74.215385 | 754 | 0.753731 |
1f997dd2b1999b88c13e0ff60593a47e15099511 | 15,152 | css | CSS | public/dist/styles.min.css | AndrewHaine/hain.ee | 8dd1f95edb6d7e2c1b42b244a512bca7b1786cb3 | [
"MIT"
] | null | null | null | public/dist/styles.min.css | AndrewHaine/hain.ee | 8dd1f95edb6d7e2c1b42b244a512bca7b1786cb3 | [
"MIT"
] | 1 | 2018-01-30T18:51:20.000Z | 2018-02-11T22:12:45.000Z | public/dist/styles.min.css | AndrewHaine/hain.ee | 8dd1f95edb6d7e2c1b42b244a512bca7b1786cb3 | [
"MIT"
] | null | null | null | /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.15}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{-webkit-text-decoration-skip:objects;background-color:transparent}abbr[title]{-webkit-text-decoration:underline dotted;border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}@-webkit-keyframes fadeAndScale{0%{-webkit-transform:scale(.9);opacity:1;transform:scale(.9)}to{-webkit-transform:scale(1.2);opacity:0;transform:scale(1.2)}}@keyframes fadeAndScale{0%{-webkit-transform:scale(.9);opacity:1;transform:scale(.9)}to{-webkit-transform:scale(1.2);opacity:0;transform:scale(1.2)}}*{-webkit-box-sizing:border-box;box-sizing:border-box}body{-webkit-font-smoothing:antialiased;background-position:50%;background-size:cover;font-family:Fira Sans,sans-serif;margin:0;min-height:100vh;overflow-x:hidden;padding:4rem 0;position:relative;width:100vw;z-index:-1}body,body:before{display:block;top:0}body:before{background:linear-gradient(36deg,#d81159,#ffbc42 90%);content:"";height:100%;left:0;opacity:.84;pointer-events:none;position:absolute;width:100%;z-index:0}.content,.footer{position:relative;z-index:3}.content{-ms-flex-align:center;-ms-flex-direction:column;-ms-flex-pack:center;-webkit-box-align:center;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-box-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;flex-direction:column;justify-content:center;margin:0 auto;max-width:1140px;min-height:65vh;width:90%}@media screen and (min-width:680px){.content{min-height:75vh}}@media screen and (min-width:960px){.content{min-height:80vh}}.page__content{max-width:480px;text-align:center;width:90%}.content__errorPage{-ms-flex-item-align:start;align-self:flex-start}.content__errorPage *{text-align:left!important}.replace{display:inline-block;text-indent:-99999px;white-space:nowrap}.footer__icon{background-position:50%;background-size:auto 100%;height:1.2em;margin:0 .5em;width:1.2em}.footer__icon--gh{background-image:url("data:image/svg+xml,%3Csvg aria-labelledby='title' role='img' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23FFF' clip-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='1.414'%3E%3Ctitle%3EGitHub icon%3C/title%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")}.footer__icon--twitter{background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23FFF' clip-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='1.414'%3E%3Cpath d='M16 3.038c-.59.26-1.22.437-1.885.517.677-.407 1.198-1.05 1.443-1.816-.634.37-1.337.64-2.085.79-.598-.64-1.45-1.04-2.396-1.04-1.812 0-3.282 1.47-3.282 3.28 0 .26.03.51.085.75-2.728-.13-5.147-1.44-6.766-3.42C.83 2.58.67 3.14.67 3.75c0 1.14.58 2.143 1.46 2.732-.538-.017-1.045-.165-1.487-.41v.04c0 1.59 1.13 2.918 2.633 3.22-.276.074-.566.114-.865.114-.21 0-.41-.02-.61-.058.42 1.304 1.63 2.253 3.07 2.28-1.12.88-2.54 1.404-4.07 1.404-.26 0-.52-.015-.78-.045 1.46.93 3.18 1.474 5.04 1.474 6.04 0 9.34-5 9.34-9.33 0-.14 0-.28-.01-.42.64-.46 1.2-1.04 1.64-1.7z' fill-rule='nonzero'/%3E%3C/svg%3E")}.field.text input{border:0;border-radius:4px;color:#d81159;font-family:Fira Sans,sans-serif;font-size:110%;padding:1rem 2rem .8rem 1rem}.field.text input::-webkit-input-placeholder{color:#c8c0c0;font-family:Fira Sans,sans-serif;font-weight:200}.field.text input:-ms-input-placeholder,.field.text input::-ms-input-placeholder{color:#c8c0c0;font-family:Fira Sans,sans-serif;font-weight:200}.field.text input::placeholder{color:#c8c0c0;font-family:Fira Sans,sans-serif;font-weight:200}button{font-weight:500}form.url-form{-ms-flex-align:center;-ms-flex-direction:column;-ms-flex-pack:center;-webkit-box-align:center;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-box-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;flex-direction:column;justify-content:center;margin-top:3rem;width:100%}form.url-form .field.text{position:relative;width:100%}form.url-form .field.text input{-webkit-box-shadow:0 1px 4px rgba(0,0,0,.3);-webkit-transition:all .2s ease-in-out;border-radius:4px;box-shadow:0 1px 4px rgba(0,0,0,.3);transition:all .2s ease-in-out;width:100%}form.url-form .field.text input:focus{background:#fff2db;outline:none}form.url-form .field.text input:focus::-webkit-input-placeholder{color:#565656}form.url-form .field.text input:focus:-ms-input-placeholder,form.url-form .field.text input:focus::-ms-input-placeholder{color:#565656}form.url-form .field.text input:focus::placeholder{color:#565656}form.url-form .form__actions{margin-top:1rem;text-align:center}form.url-form label{display:none}@media screen and (min-width:600px){form.url-form{-ms-flex-align:stretch;-ms-flex-direction:row;-webkit-box-align:stretch;-webkit-box-direction:normal;-webkit-box-orient:horizontal;align-items:stretch;flex-direction:row}form.url-form .field.text{-ms-flex-positive:6;-webkit-box-flex:6;flex-grow:6;width:auto}form.url-form .field.text input{width:100%}form.url-form .form__actions{-ms-flex-pack:end;-ms-flex-positive:1;-webkit-box-flex:1;-webkit-box-pack:end;display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;justify-content:flex-end;margin-top:0}form.url-form .form__actions button{margin-left:1rem}}#form-container{max-width:600px;min-height:300px;width:83%}#form-container,.urlform__container{position:relative}.form-error{-webkit-transform:translateY(-20%);-webkit-transition:none;background:rgba(173,0,0,.4);border-radius:3px;display:block;font-size:90%;opacity:0;padding:.5rem 1rem .4rem;position:absolute;top:260%;transform:translateY(-20%);transition:none;visibility:hidden}.form-error[data-erroring=true]{-webkit-transform:none;-webkit-transition:all .3s ease-in-out;opacity:1;transform:none;transition:all .3s ease-in-out;visibility:visible}@media screen and (min-width:600px){.form-error{top:140%}}.button__shorten{-webkit-box-shadow:0 2px 3px rgba(0,0,0,.2);-webkit-transition:all .1s ease-in-out;background-color:#5ac752;border:0;border-radius:4px;box-shadow:0 2px 3px rgba(0,0,0,.2);color:#fff;cursor:pointer;font-family:Fira Sans,sans-serif;outline:none;padding:.7rem 2rem;transition:all .1s ease-in-out}.button__shorten:focus,.button__shorten:hover{background-color:#43b53b}.button__shorten:active{-webkit-transform:scale(.9);transform:scale(.9)}.button{-webkit-box-shadow:0 2px 3px rgba(0,0,0,.2);-webkit-transition:all .1s ease-in-out;border:0;border-radius:4px;box-shadow:0 2px 3px rgba(0,0,0,.2);cursor:pointer;display:inline-block;font-family:Fira Sans,sans-serif;margin:2rem 0;outline:none;padding:.7rem 2rem;text-decoration:none;transition:all .1s ease-in-out}.button--green{background:#5ac752;color:#fff}.button--razmatazz{background:#d81159;color:#fff}.shorten-preview{-webkit-transform-origin:50% 0;background:hsla(0,0%,100%,.8);border-radius:5px;display:block;padding:1rem;position:absolute;top:120%;transform-origin:50% 0;width:100%;z-index:100}.shorten-preview:before{background-image:url("data:image/svg+xml,%3C?xml version='1.0' encoding='UTF-8'?%3E %3Csvg width='58px' height='58px' viewBox='0 0 58 58' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.8'%3E %3Cg id='Artboard' fill='%23FFFFFF'%3E %3Cpath d='M34.5406397,26.7539908 L58,58 L-0.114444714,58 L23.3449156,26.7539908 L23.3449156,26.7539908 C25.6660851,23.662377 30.0540129,23.0378084 33.1456268,25.3589779 C33.6741552,25.7557946 34.1438229,26.2254623 34.5406397,26.7539908 Z' id='Rectangle-7'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/svg%3E");background-position:auto 100%;background-size:100% auto;content:"";height:20px;left:calc(50% - 10px);position:absolute;top:-20px;width:20px}@media screen and (min-width:600px){.shorten-preview{padding:1.7rem;top:140%}.shorten-preview:before{left:8%}}.shorten-preview__content{-ms-flex-pack:start;-webkit-box-pack:start;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:flex-start}.shorten-preview__image{-ms-flex-negative:0;background:#e0dbdb;background-position:50%;background-repeat:no-repeat;background-size:contain;border-radius:4px;display:none;flex-shrink:0;height:65px;overflow:hidden;position:relative;width:65px}.shorten-preview__image:before{-webkit-animation:leftToRight 1.4s ease-in-out infinite;animation:leftToRight 1.4s ease-in-out infinite;background-image:-webkit-gradient(linear,left top,right top,from(#e0dbdb),color-stop(50%,#d4cdcd),to(#e0dbdb));background-image:linear-gradient(90deg,#e0dbdb,#d4cdcd 50%,#e0dbdb);content:"";display:block;height:100%;left:0;opacity:.5;position:absolute;top:0;width:50%}@media screen and (min-width:375px){.shorten-preview__image{display:block}}@media screen and (min-width:600px){.shorten-preview__image{height:80px;width:80px}}@-webkit-keyframes leftToRight{0%{left:-100%}to{left:100%}}@keyframes leftToRight{0%{left:-100%}to{left:100%}}.shorten-preview__text{-ms-flex-align:start;-ms-flex-direction:column;-webkit-box-align:start;-webkit-box-direction:normal;-webkit-box-orient:vertical;align-items:flex-start;display:-webkit-box;display:-ms-flexbox;display:flex;flex-direction:column;width:100%}@media screen and (min-width:375px){.shorten-preview__text{padding-left:1rem}}@media screen and (min-width:600px){.shorten-preview__text{padding-left:1.4rem}}.shorten-preview__link,.shorten-preview__title{background:#e0dbdb;display:block;min-height:1em;overflow:hidden;padding:.4em;position:relative}.shorten-preview__link:before,.shorten-preview__title:before{-webkit-animation:leftToRight 1.4s ease-in-out infinite;-webkit-animation-delay:.4s;animation:leftToRight 1.4s ease-in-out infinite;animation-delay:.4s;background-image:-webkit-gradient(linear,left top,right top,from(#e0dbdb),color-stop(50%,#d4cdcd),to(#e0dbdb));background-image:linear-gradient(90deg,#e0dbdb,#d4cdcd 50%,#e0dbdb);content:"";display:block;height:100%;left:0;position:absolute;top:0;width:50%}.shorten-preview__title{color:#565656;font-weight:700;line-height:1.35;margin-bottom:.8em;min-width:70%;overflow:hidden}@media screen and (min-width:650px){.shorten-preview__title{font-size:1.2rem}}.shorten-preview__link{color:#999;cursor:pointer;font-size:.9em;font-weight:100;min-width:55%;text-decoration:underline}.shorten-preview__link:hover{text-decoration:none}.shorten-preview__content--active .shorten-preview__image,.shorten-preview__content--active .shorten-preview__link,.shorten-preview__content--active .shorten-preview__title{background-color:transparent;padding:0!important}.shorten-preview__content--active .shorten-preview__image:before,.shorten-preview__content--active .shorten-preview__link:before,.shorten-preview__content--active .shorten-preview__title:before{display:none}.shorten-preview__content--active .shorten-preview__title{margin-bottom:.4rem}@-webkit-keyframes fadeAndFold{0%{-webkit-transform:rotateX(45deg) translateY(-20px);opacity:0;transform:rotateX(45deg) translateY(-20px)}to{-webkit-transform:none;opacity:1;transform:none}}@keyframes fadeAndFold{0%{-webkit-transform:rotateX(45deg) translateY(-20px);opacity:0;transform:rotateX(45deg) translateY(-20px)}to{-webkit-transform:none;opacity:1;transform:none}}.preview-box-animation-enter-active{-webkit-animation:fadeAndFold .5s ease;animation:fadeAndFold .5s ease}.preview-box-animation-leave-active{animation:fadeAndFold .3s ease-out reverse}body{color:#fff;font-size:90%}body a{color:#fff;font-weight:600}body a:hover{text-decoration:none}@media screen and (min-width:500px){body{font-size:100%}}h1{color:#fff;font-family:Pacifico,sans-serif;font-size:3.8em;margin:0 auto .2em;text-align:center}@media screen and (min-width:900px){h1{font-size:4.5em}}@media screen and (min-width:1200px){h1{font-size:6em}}.footer{bottom:0;display:block;font-size:70%;padding:3rem 0 1.5rem;position:absolute;text-align:center;width:100%}.footer__inner{margin:0 auto;max-width:1240px;width:95%}.footer__inner .footer__me-credit,.footer__inner .footer__photo-credit{display:block;margin:.6rem 0}.footer__homesite{display:inline-block;margin-right:1em}@media screen and (min-width:600px){.footer{text-align:left}.footer__inner{-ms-flex-pack:justify;-webkit-box-pack:justify;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}}
/*# sourceMappingURL=styles.min.css.map*/ | 7,576 | 15,110 | 0.781481 |
70743c633a659a26be21a5a5ffaa1bbae1460b0f | 8,571 | lua | Lua | bin/splice_genes_at_gaps.lua | WenchaoLin/annot-nf | be254ae3f9d063c02343ba698a3b241917c626ed | [
"0BSD"
] | null | null | null | bin/splice_genes_at_gaps.lua | WenchaoLin/annot-nf | be254ae3f9d063c02343ba698a3b241917c626ed | [
"0BSD"
] | null | null | null | bin/splice_genes_at_gaps.lua | WenchaoLin/annot-nf | be254ae3f9d063c02343ba698a3b241917c626ed | [
"0BSD"
] | 2 | 2015-09-22T04:22:45.000Z | 2021-07-24T23:59:20.000Z | #!/usr/bin/env gt
--[[
Copyright (c) 2014 Sascha Steinbiss <ss34@sanger.ac.uk>
Copyright (c) 2014 Genome Research Ltd
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
]]
function usage()
io.stderr:write(string.format("Usage: %s <GFF w/ genes + gaps>\n" , arg[0]))
os.exit(1)
end
if #arg < 1 then
usage()
end
package.path = gt.script_dir .. "/?.lua;" .. package.path
require("lib")
function ReverseTable(t)
local reversedTable = {}
local itemCount = #t
for k, v in ipairs(t) do
reversedTable[itemCount + 1 - k] = v
end
return reversedTable
end
stream = gt.custom_stream_new_unsorted()
stream.outqueue = {}
stream.curr_gene_set = {}
stream.curr_rng = nil
stream.last_seqid = nil
function stream:process_current_cluster()
local gaps = {}
-- count and collect intra-scaffold gaps
for _,n in ipairs(self.curr_gene_set) do
if n:get_type() == "gap"
and n:get_attribute("gap_type") == "within scaffold" then
table.insert(gaps, n)
end
end
-- no inter-contig gaps in cluster, so just pass along genes
if #gaps == 0 then
for _,n in ipairs(self.curr_gene_set) do
table.insert(stream.outqueue, n)
end
return 0
end
-- split CDS of each gene
for _,n in ipairs(self.curr_gene_set) do
local cur_gene = n
local outbuf = {}
local cur_cds = nil
if n:get_type() ~= "gap" then
for _,g in ipairs(gaps) do
local mrna = nil
for c in cur_gene:children() do
if c:get_type() == "mRNA" then
mrna = c
end
if c:get_type() == "CDS" then
local new_cds = nil
if c:get_range():overlap(g:get_range()) then
if not cur_cds then
cur_cds = c
end
local new_rng = gt.range_new(c:get_range():get_start(),
g:get_range():get_start() - 1)
local rest_rng = gt.range_new(g:get_range():get_end() + 1,
c:get_range():get_end())
c:set_range(new_rng)
new_cds = gt.feature_node_new(c:get_seqid(), "CDS",
rest_rng:get_start(),
rest_rng:get_end(),
c:get_strand())
mrna:add_child(new_cds)
new_cds:set_source(c:get_source())
table.insert(outbuf, cur_cds)
table.insert(outbuf, g)
end
cur_cds = new_cds
end
end
table.insert(outbuf, cur_cds)
end
-- repair CDS entries in gene models to fix frameshifts
local cdslist = {}
for _,v in ipairs(outbuf) do
for q in v:children() do
if q:get_type() == "CDS" or q:get_type() == "gap" then
table.insert(cdslist, q)
end
end
end
if #cdslist > 0 then
n:set_attribute("internalGap", "true")
-- reverse order for reverse strand features
assert(cdslist[1]:get_type() == "CDS")
local startphase = cdslist[1]:get_phase()
if n:get_strand() == "-" then
cdslist = ReverseTable(cdslist)
cdslist[1]:set_phase(startphase)
end
-- update phases
assert(cdslist[1]:get_type() == "CDS")
local gaplen = 0
local nofgaps = 0
for i = 2,#cdslist do
if cdslist[i]:get_type() == "gap" then
gaplen = cdslist[i]:get_range():length()
nofgaps = nofgaps + 1
elseif cdslist[i]:get_type() == "CDS" then
-- adjust coords for shift introduced by gap length, if necessary
local shift = 0
if (gaplen % 3) ~= 0 then
shift = 3 - (gaplen % 3)
end
local newrng = nil
if cdslist[i]:get_strand() == "-" then
newrng = gt.range_new(cdslist[i]:get_range():get_start(),
cdslist[i]:get_range():get_end() - shift)
else
newrng = gt.range_new(cdslist[i]:get_range():get_start() + shift,
cdslist[i]:get_range():get_end())
end
cdslist[i]:set_range(newrng)
end
end
-- take care of boundary case where after frameshift adjustment, the
-- terminal CDS ends up too short to still contain a stop codon on
-- its own
if #cdslist > 2 and cdslist[#cdslist]:get_range():length() < 3 then
local last_cds_range = cdslist[#cdslist-2]:get_range()
-- in this case, drop it
n:remove_leaf(cdslist[#cdslist])
-- if there was only one gap, remove internal gap flag
if nofgaps == 1 then
n:remove_attribute("internalGap")
end
-- add appropriate partial flag
if n:get_strand() == "-" then
n:set_attribute("Start_range",".,.")
else
n:set_attribute("End_range",".,.")
end
-- readjust gene coordinates across this CC
for this_child in n:children() do
if this_child:get_range():overlap(last_cds_range) then
if last_cds_range:get_start() > this_child:get_range():get_start() then
local rng = gt.range_new(last_cds_range:get_start(),
this_child:get_range():get_end())
this_child:set_range(rng)
end
if last_cds_range:get_end() < this_child:get_range():get_end() then
local rng = gt.range_new(this_child:get_range():get_start(),
last_cds_range:get_end())
this_child:set_range(rng)
end
end
end
end
end
end
table.insert(self.outqueue, n)
end
end
function stream:next_tree()
local complete_cluster = false
local mygn = nil
if #self.outqueue > 0 then
return table.remove(self.outqueue, 1)
else
complete_cluster = false
end
while not complete_cluster do
mygn = self.instream:next_tree()
if mygn then
rval, err = pcall(GenomeTools_genome_node.get_type, mygn)
if rval then
local fn = mygn
local new_rng = mygn:get_range()
if fn:get_type() == "gene" or fn:get_type() == "gap" then
if #self.curr_gene_set == 0 then
table.insert(self.curr_gene_set, fn)
self.curr_rng = new_rng
else
if self.last_seqid == fn:get_seqid()
and self.curr_rng:overlap(new_rng) then
table.insert(self.curr_gene_set, fn)
self.curr_rng = self.curr_rng:join(new_rng)
else
-- no more overlap
self:process_current_cluster()
self.curr_gene_set = {}
table.insert(self.curr_gene_set, fn)
self.curr_rng = new_rng
if #self.outqueue > 0 then
outgn = table.remove(self.outqueue, 1)
complete_cluster = true
end
end
end
self.last_seqid = mygn:get_seqid()
else
table.insert(self.outqueue, fn)
end
else
-- no feature node
self:process_current_cluster()
self.curr_gene_set = {}
table.insert(self.outqueue, fn)
if #self.outqueue > 0 then
outgn = table.remove(self.outqueue, 1)
complete_cluster = true
end
end
else
-- end of annotation
outgn = mygn
break
end
end
return outgn
end
stream.instream = gt.gff3_in_stream_new_sorted(arg[1])
stream.vis = visitor
stream.idx = feature_index
out_stream = gt.gff3_out_stream_new(stream)
local gn = out_stream:next_tree()
while (gn) do
gn = out_stream:next_tree()
end
| 32.71374 | 85 | 0.567028 |
269789ead1e7e40e24f9e9f31badae99363d3318 | 277 | java | Java | app/jobs/InitJob.java | Telson/dcs-http | a838f6f8bf4d2b1cc8bf15b21ae907a5e349129f | [
"MIT"
] | 29 | 2015-08-14T03:18:45.000Z | 2022-02-19T23:48:04.000Z | app/jobs/InitJob.java | FlightControl-Master/dcs-http | a838f6f8bf4d2b1cc8bf15b21ae907a5e349129f | [
"MIT"
] | 1 | 2016-12-02T11:44:52.000Z | 2018-07-10T02:45:20.000Z | app/jobs/InitJob.java | FlightControl-Master/dcs-http | a838f6f8bf4d2b1cc8bf15b21ae907a5e349129f | [
"MIT"
] | 6 | 2017-08-09T23:22:02.000Z | 2022-02-19T23:48:07.000Z | package jobs;
import play.jobs.Job;
import play.jobs.OnApplicationStart;
import util.DcsSocket;
@OnApplicationStart
public class InitJob extends Job
{
@Override
public void doJob()
{
DcsSocket socket = new DcsSocket();
new Thread(socket).start();
}
}
| 16.294118 | 38 | 0.703971 |
12ae77ddfdacc2ea3e18d9dd1760c4797540b44a | 197 | kt | Kotlin | tmp/arrays/youTrackTests/158.kt | vitekkor/bbfgradle | b4ec701a7a3b7523db97631fa0ed6484149ca9cd | [
"Apache-2.0"
] | 1 | 2021-04-06T16:59:24.000Z | 2021-04-06T16:59:24.000Z | tmp/arrays/youTrackTests/158.kt | vitekkor/bbfgradle | b4ec701a7a3b7523db97631fa0ed6484149ca9cd | [
"Apache-2.0"
] | null | null | null | tmp/arrays/youTrackTests/158.kt | vitekkor/bbfgradle | b4ec701a7a3b7523db97631fa0ed6484149ca9cd | [
"Apache-2.0"
] | 11 | 2020-03-23T08:28:36.000Z | 2022-03-22T07:04:42.000Z | // Original bug: KT-28233
//Foo.kt
interface Foo {
val values: Type
}
//FooImpl.kt
class FooImpl : Foo {
override val values: Type
get() = "0"
}
//types.kt
typealias Type = String
| 14.071429 | 29 | 0.624365 |
5cc64c30c97b88d27b469471224d2dd82239d186 | 554 | css | CSS | src/style.css | leotranq/Random-Poker-card | 29d5c50307268fae3d73d204b98633b47345905b | [
"MIT"
] | null | null | null | src/style.css | leotranq/Random-Poker-card | 29d5c50307268fae3d73d204b98633b47345905b | [
"MIT"
] | null | null | null | src/style.css | leotranq/Random-Poker-card | 29d5c50307268fae3d73d204b98633b47345905b | [
"MIT"
] | null | null | null | @import "~bootstrap/dist/css/bootstrap.min.css";
body {
background-color: rgb(76, 167, 76);
}
#card-body {
border: solid black !important;
border-width: 1px;
max-width: 18rem;
background-color: rgb(49, 250, 59);
padding: 10px;
}
#top-card {
text-align: left;
background-color: rgb(106, 208, 255);
font-size: 50px;
}
#content-card {
background-color: rgb(106, 208, 255);
height: 250px;
text-align: center;
padding: 30%;
}
#bottom-card {
text-align: end !important;
background-color: rgb(106, 208, 255);
font-size: 50px;
}
| 19.103448 | 48 | 0.65704 |
fd6be0edab7fd4d7df47e53f65675f108723fe75 | 4,422 | h | C | src/utils.h | coronin/CRISPR-Analyser | 8093a920696f6bf03708d2c8cdb83d9107fd1488 | [
"MIT"
] | 1 | 2018-01-16T16:48:36.000Z | 2018-01-16T16:48:36.000Z | src/utils.h | coronin/CRISPR-Analyser | 8093a920696f6bf03708d2c8cdb83d9107fd1488 | [
"MIT"
] | null | null | null | src/utils.h | coronin/CRISPR-Analyser | 8093a920696f6bf03708d2c8cdb83d9107fd1488 | [
"MIT"
] | null | null | null | #ifndef __UTILS__
#define __UTILS__
#include <vector>
#include <string>
#include <sstream>
#include <deque>
#define ERROR_STR 0xFFFFFFFFFFFFFFFFull
namespace std {
string to_string(const string & str);
}
namespace util {
//unsigned int pop_count(uint64_t x);
std::vector<std::string> split(const std::string & text);
void print_binary(uint64_t data);
std::string bits_to_string(uint64_t text, int size);
uint64_t string_to_bits(uint8_t * cmap, const std::string & seq, short base);
uint64_t revcom(uint64_t text, int size);
std::string revcom(std::string text);
void lc(std::string & str);
bool valid_pam_left(std::deque<char> & seq, std::string pam);
bool valid_pam_right(std::deque<char> & seq, std::string pam);
bool valid_pam(std::deque<char> & seq, std::string pam, bool pam_right);
/**
* @brief Count the number of bits set to 1 in a given 64bit integer
* this is about twice as fast as __builtin_popcountll
* inlining seems to shave a bit more off
*
* @param x the integer to count
* @return the number of bits set to 1 as an unsigned integer
*/
inline unsigned int pop_count(uint64_t x) {
//as everything is two bit we must convert them all to one bit,
//to do this we must turn off all MSBs, but before we can do that
//we need to ensure that when an MSB is set to 1, the LSB is also set.
//the 4 will change pam_right to 0 so it doesnt get counted.
//5 is 0101, 4 is 0100
//x = (x | (x >> 1)) & (0x5555545555555555ull);
x = (x | (x >> 1)) & (0x5555555555555555ull);
x = x-( (x>>1) & 0x5555555555555555ull);
x = (x & 0x3333333333333333ull) + ((x >> 2) & 0x3333333333333333ull);
x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0full;
return (0x0101010101010101ull*x >> 56);
}
/**
* @brief Create a JSON string representation of a container (e.g. vector)
* Implemented here because templates suck. otherwise I'd have to declare
* every type I support manually
*
*
* @param begin iterator begin, pointing to a container
* @param end iterator end
* @param include_idx whether or not the index should be included
*
* @return JSON string
*/
template <typename T>
std::string format_off_targets(const T & list) {
//if its empty return
if ( list.empty() )
return "{}";
//to make sure we don't have to re-allocate memory we reserve enough
//space for the whole string.
//each entry in list has a minimum of '0: 1,' which is 5 characters
//more realistically it will be something like '4: 9999,' which is 8
//plus {} which is 2
//so this gives us a good approximation of the size
std::string result = "{";
result.reserve( (list.size()*8) + 2 );
//iterate over array, appending each value to the string
uint64_t index = 0;
for ( auto it = list.begin(); it != list.end(); ++it ) {
result.append(std::to_string(index++)).append(": ").append( std::to_string( *it ) );
if (index != list.size()) result.append(", ");
}
result += "}";
return result;
}
//useful for structs so you can override the <<
template <class T>
inline std::string to_string (const T & t) {
std::stringstream ss;
ss << t;
return ss.str();
}
template <typename T>
std::string to_json_array(const T & list, bool quote_all = false) {
std::string result = "[";
for ( size_t i = 0; i < list.size(); ++i ) {
std::string temp = std::to_string(list[i]);
//quote all would be set to true if you were passing in strings
result += quote_all ? "'"+temp+"'" : temp;
if ( i != list.size()-1 ) result += ",";
}
result += "]";
return result;
}
template <typename T>
std::string to_postgres_array(const T & list, bool quote_all = false) {
std::string result = to_json_array(list, quote_all);
result.front() = '{';
result.back() = '}';
return result;
}
template <typename T>
std::string container_to_string(const T & list) {
std::string result(list.size(), '-');
for ( size_t i = 0; i < list.size(); ++i ) {
result[i] = list[i];
}
return result;
}
}
#endif
| 32.043478 | 96 | 0.597015 |
4dc1eebce17e5baa7dcda039392c6debe6dcb3cb | 8,541 | swift | Swift | Sources/SwiftSDAIcore/SDAI/DataTypes/SdaiGeneric.swift | tsun7170/SwiftSDAIcore | 335267a76b026e353078d9de3572d6f54704298d | [
"MIT"
] | 1 | 2021-11-23T08:46:34.000Z | 2021-11-23T08:46:34.000Z | Sources/SwiftSDAIcore/SDAI/DataTypes/SdaiGeneric.swift | tsun7170/SwiftSDAIcore | 335267a76b026e353078d9de3572d6f54704298d | [
"MIT"
] | null | null | null | Sources/SwiftSDAIcore/SDAI/DataTypes/SdaiGeneric.swift | tsun7170/SwiftSDAIcore | 335267a76b026e353078d9de3572d6f54704298d | [
"MIT"
] | null | null | null | //
// SdaiGeneric.swift
//
//
// Created by Yoshida on 2021/02/07.
// Copyright © 2021 Tsutomu Yoshida, Minokamo, Japan. All rights reserved.
//
import Foundation
// abstruct superclass
fileprivate class _AnyGenericBox: Hashable {
static func == (lhs: _AnyGenericBox, rhs: _AnyGenericBox) -> Bool {
return lhs.base == rhs.base
}
func hash(into hasher: inout Hasher) {
hasher.combine(base)
}
var base: AnyHashable { abstruct() }
func copy() -> AnyHashable { abstruct() }
var isCachable: Bool { abstruct() }
var value: SDAI.GenericValue { abstruct() }
var entityReference: SDAI.EntityReference? { abstruct() }
var stringValue: SDAI.STRING? { abstruct() }
var binaryValue: SDAI.BINARY? { abstruct() }
var logicalValue: SDAI.LOGICAL? { abstruct() }
var booleanValue: SDAI.BOOLEAN? { abstruct() }
var numberValue: SDAI.NUMBER? { abstruct() }
var realValue: SDAI.REAL? { abstruct() }
var integerValue: SDAI.INTEGER? { abstruct() }
var genericEnumValue: SDAI.GenericEnumValue? { abstruct() }
var entityReferences: AnySequence<SDAI.EntityReference> { abstruct() }
func configure(with observer: SDAI.EntityReferenceObserver) { abstruct() }
func teardownObserver() { abstruct() }
func arrayOptionalValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.ARRAY_OPTIONAL<ELEM>? { abstruct() }
func arrayValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.ARRAY<ELEM>? { abstruct() }
func listValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.LIST<ELEM>? { abstruct() }
func bagValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.BAG<ELEM>? { abstruct() }
func setValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.SET<ELEM>? { abstruct() }
func enumValue<ENUM:SDAIEnumerationType>(enumType:ENUM.Type) -> ENUM? { abstruct() }
class func validateWhereRules(instance:_AnyGenericBox?, prefix:SDAI.WhereLabel) -> [SDAI.WhereLabel:SDAI.LOGICAL] { abstruct() }
}
fileprivate final class _GenericBox<G: SDAIGenericType>: _AnyGenericBox {
private var _base: G
init(_ base: G){
assert(type(of: base) != SDAI.GENERIC.self)
self._base = base
}
override var base: AnyHashable { _base }
override func copy() -> AnyHashable { _base.copy() }
override var isCachable: Bool { _base.isCachable }
override var value: SDAI.GenericValue { _base.value as SDAI.GenericValue }
override var entityReference: SDAI.EntityReference? { _base.entityReference }
override var stringValue: SDAI.STRING? { _base.stringValue }
override var binaryValue: SDAI.BINARY? { _base.binaryValue }
override var logicalValue: SDAI.LOGICAL? { _base.logicalValue }
override var booleanValue: SDAI.BOOLEAN? { _base.booleanValue }
override var numberValue: SDAI.NUMBER? { _base.numberValue }
override var realValue: SDAI.REAL? { _base.realValue }
override var integerValue: SDAI.INTEGER? { _base.integerValue }
override var genericEnumValue: SDAI.GenericEnumValue? { _base.genericEnumValue }
override var entityReferences: AnySequence<SDAI.EntityReference> {
if let base = (self._base as Any) as? SDAIObservableAggregateElement {
return base.entityReferences
}
else {
return AnySequence<SDAI.EntityReference>([])
}
}
override func configure(with observer: SDAI.EntityReferenceObserver) {
if var base = (self._base as Any) as? SDAIObservableAggregateElement {
base.configure(with: observer)
self._base = base as! G
}
}
override func teardownObserver() {
if var base = (self._base as Any) as? SDAIObservableAggregateElement {
base.teardownObserver()
self._base = base as! G
}
}
override func arrayOptionalValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.ARRAY_OPTIONAL<ELEM>? { _base.arrayOptionalValue(elementType: elementType) }
override func arrayValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.ARRAY<ELEM>? { _base.arrayValue(elementType: elementType) }
override func listValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.LIST<ELEM>? { _base.listValue(elementType: elementType) }
override func bagValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.BAG<ELEM>? { _base.bagValue(elementType: elementType) }
override func setValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.SET<ELEM>? { _base.setValue(elementType: elementType) }
override func enumValue<ENUM:SDAIEnumerationType>(enumType:ENUM.Type) -> ENUM? { _base.enumValue(enumType: enumType) }
override class func validateWhereRules(instance:_AnyGenericBox?, prefix:SDAI.WhereLabel) -> [SDAI.WhereLabel:SDAI.LOGICAL] {
guard let instance = instance as? Self else { return [:] }
return G.validateWhereRules(instance:instance._base, prefix: prefix)
}
}
public protocol SDAI__GENERIC__type: SDAIGenericType, SDAIObservableAggregateElement
{}
extension SDAI {
public struct GENERIC: SDAI__GENERIC__type, CustomStringConvertible {
public typealias FundamentalType = Self
public typealias Value = GenericValue
private var box: _AnyGenericBox
// CustomStringConvertible
public var description: String { "GENERIC(\(box.base))" }
public init?<G: SDAIGenericType>(_ generic: G?) {
guard let generic = generic else { return nil }
self.init(generic)
}
public init<G: SDAIGenericType>(_ generic: G) {
if let generic = generic as? GENERIC {
box = generic.box
}
else {
box = _GenericBox<G>(generic.copy())
}
// let validation = self.entityReferences
// for item in validation {
// assert(item is SDAI.EntityReference)
// }
}
public var base: AnyHashable { box.base }
// InitializableByGenerictype
public init?<G: SDAIGenericType>(fromGeneric generic: G?){
self.init(generic)
}
// SdaiCachableSource
public var isCachable: Bool { box.isCachable }
// SDAIGenericType
public func copy() -> SDAI.GENERIC { return self }
public var asFundamentalType: FundamentalType { return self }
public init(fundamental: FundamentalType) {
box = fundamental.box
}
public static var typeName: String { "GENERIC" }
public var typeMembers: Set<SDAI.STRING> { return [SDAI.STRING(Self.typeName)] }
public var value: Value { box.value }
public var entityReference: SDAI.EntityReference? { box.entityReference }
public var stringValue: SDAI.STRING? { box.stringValue }
public var binaryValue: SDAI.BINARY? { box.binaryValue }
public var logicalValue: SDAI.LOGICAL? { box.logicalValue }
public var booleanValue: SDAI.BOOLEAN? {box.booleanValue }
public var numberValue: SDAI.NUMBER? { box.numberValue }
public var realValue: SDAI.REAL? { box.realValue }
public var integerValue: SDAI.INTEGER? { box.integerValue }
public var genericEnumValue: SDAI.GenericEnumValue? { box.genericEnumValue }
public func arrayOptionalValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.ARRAY_OPTIONAL<ELEM>? { box.arrayOptionalValue(elementType: elementType) }
public func arrayValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.ARRAY<ELEM>? { box.arrayValue(elementType: elementType) }
public func listValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.LIST<ELEM>? { box.listValue(elementType: elementType) }
public func bagValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.BAG<ELEM>? { box.bagValue(elementType: elementType) }
public func setValue<ELEM:SDAIGenericType>(elementType:ELEM.Type) -> SDAI.SET<ELEM>? { box.setValue(elementType: elementType) }
public func enumValue<ENUM:SDAIEnumerationType>(enumType:ENUM.Type) -> ENUM? { box.enumValue(enumType: enumType) }
public static func validateWhereRules(instance:Self?, prefix:SDAI.WhereLabel) -> [SDAI.WhereLabel:SDAI.LOGICAL] {
guard let instance = instance else { return [:] }
let basetype = type(of: instance.box)
if !((basetype as Any) is SDAI.EntityReference) { return [:] }
return basetype.validateWhereRules(instance:instance.box, prefix: prefix)
}
// SDAIObservableAggregateElement
public var entityReferences: AnySequence<SDAI.EntityReference> {
return box.entityReferences
}
public mutating func configure(with observer: SDAI.EntityReferenceObserver) {
box.configure(with: observer)
}
public mutating func teardownObserver() {
box.teardownObserver()
}
// InitializableByP21Parameter
public static var bareTypeName: String = "GENERIC"
public init?(p21untypedParam: P21Decode.ExchangeStructure.UntypedParameter, from exchangeStructure: P21Decode.ExchangeStructure) {
abstruct()
}
public init?(p21omittedParamfrom exchangeStructure: P21Decode.ExchangeStructure) {
abstruct()
}
}
}
| 42.073892 | 163 | 0.74359 |
70f0bf2b0688e3953232960186bbb7edc2688fb8 | 1,434 | c | C | Week 4/majority_element.c | fontesrp/Algorithmic-Toolbox | c27b803bb79a42bfdfbe55eb64458d93b8ac588b | [
"MIT"
] | null | null | null | Week 4/majority_element.c | fontesrp/Algorithmic-Toolbox | c27b803bb79a42bfdfbe55eb64458d93b8ac588b | [
"MIT"
] | null | null | null | Week 4/majority_element.c | fontesrp/Algorithmic-Toolbox | c27b803bb79a42bfdfbe55eb64458d93b8ac588b | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
unsigned long ulBoyerMooreMajority(unsigned long * prgulVotes, unsigned long ulLen) {
unsigned long ulCandidate;
unsigned long ulLead = 0;
unsigned long ulIdx;
for (ulIdx = 0; ulIdx < ulLen; ulIdx++) {
if (ulLead == 0) {
ulCandidate = ulIdx;
ulLead = 1;
} else if (prgulVotes[ulCandidate] == prgulVotes[ulIdx]) {
ulLead++;
} else {
ulLead--;
}
}
return ulCandidate;
}
unsigned int uiMajorityElement(unsigned long * prgulVotes, unsigned long ulLen) {
unsigned long ulCandidate = ulBoyerMooreMajority(prgulVotes, ulLen);
unsigned long ulIdx;
unsigned long ulOccur = 0;
for (ulIdx = 0; ulIdx < ulLen; ulIdx++) {
if (prgulVotes[ulIdx] == prgulVotes[ulCandidate]) {
ulOccur++;
}
}
return (ulOccur > ulLen / 2) ? 1 : 0;
}
void getArrInput(unsigned long * prgulTarget, unsigned long ulLen) {
unsigned long ulIdx;
for (ulIdx = 0; ulIdx < ulLen; ulIdx++) {
scanf("%lu", &prgulTarget[ulIdx]);
}
}
int main(int argc, char const * argv[]) {
unsigned long ulLen;
scanf("%lu", &ulLen);
unsigned long * prgulVotes = (unsigned long *) malloc(ulLen * sizeof (unsigned long));
getArrInput(prgulVotes, ulLen);
printf("%u", uiMajorityElement(prgulVotes, ulLen));
free(prgulVotes);
return 0;
}
| 22.761905 | 90 | 0.60251 |
5f903ec8c40ab1407ad36bfe363b0c860491aea5 | 449 | css | CSS | Spa2/nakedobjectsspa/gemini/src/view-parameter/view-parameter.component.css | sebastianslutzky/NakedObjectsFramework | f2ee81ba1adbd54762d555e1a455ed18a0f9213c | [
"Apache-2.0"
] | 207 | 2015-01-29T22:37:11.000Z | 2022-03-17T17:34:29.000Z | Spa2/nakedobjectsspa/gemini/src/view-parameter/view-parameter.component.css | sebastianslutzky/NakedObjectsFramework | f2ee81ba1adbd54762d555e1a455ed18a0f9213c | [
"Apache-2.0"
] | 407 | 2016-05-09T10:50:24.000Z | 2022-03-25T10:47:25.000Z | Spa2/nakedobjectsspa/gemini/src/view-parameter/view-parameter.component.css | sebastianslutzky/NakedObjectsFramework | f2ee81ba1adbd54762d555e1a455ed18a0f9213c | [
"Apache-2.0"
] | 53 | 2015-01-31T16:40:54.000Z | 2021-11-29T04:00:20.000Z | :host {
width: var(--field-value-width);
padding-left: var(--space-3);
padding-right: var(--space-3);
padding-top: var(--space-1);
margin-top: var(--space-1);
margin-bottom: var(--space-1);
}
:host.multilinedialog {
padding-left: var(--space-4);
width: var(--field-value-width);
display: inline-block;
overflow: auto;
}
:host.multilinedialog .name {
display: none;
}
.reference {
cursor: pointer;
} | 19.521739 | 36 | 0.610245 |